Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to spool single quotes in text file ?
Try using the CHR() function. Insert the function anywhere in your string
where you will need the single quote to be output. Either CHR(39) or
CHR(167) should both work.
Hope this helps and works for you.
-::YEX::-
<)))><
-----Original Message-----
From: Helmut Daiminger [mailto:hdaiminger_at_vivonet.com]
Sent: Friday, November 03, 2000 1:41 PM
To: Multiple recipients of list ORACLE-L
Subject: How to spool single quotes in text file ?
Hi!
I'm trying to generate a text file, that spools all datafiles in a database and generates an alter database file.
set heading off
set feedback off
set linesize 300;
set pagesize 200;
spool c:\datafiles.sql;
select 'alter database datafile ' ||name|| ' autoextend on next 50m maxsize
1000m;' from v$datafile;
spool off
@c:\datafiles.sql
exit
How do I get Oracle to do single quotes around the datafile names? Simply using two single quotes doesn't work...
select 'alter database datafile '' ||name|| '' autoextend on next 50m maxsize 1000m;' from v$datafile;
Gives me
alter database datafile ' ||name|| ' autoextend on next 50m maxsize 1000m;
Any idea?
This is 8.1.6.
Thanks,
Helmut
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Helmut Daiminger INET: hdaiminger_at_vivonet.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Nov 03 2000 - 15:03:55 CST