Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to spool single quotes in text file ?

Re: How to spool single quotes in text file ?

From: <Brian_McQuillan_at_gelco.com>
Date: Fri, 3 Nov 2000 15:12:13 -0500
Message-Id: <10669.121108@fatcity.com>


try three quotes
like this - ithink you'll find it gives you what you need Q

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

"Helmut Daiminger" <hdaiminger_at_vivonet.com> on 11/03/2000 01:41:19 PM

Please respond to ORACLE-L_at_fatcity.com

To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: (bcc: Brian McQuillan/GELCO)

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 - 14:12:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US