Here is the same query to produce the results you wanted:
select 'alter system kill session ''' ||SID||''','''||SERIAL#||''';'
from v$session where username = 'COLUMBUSUN' and status = 'INACTIVE';
Mondie Villalobos
Oracle DBA
-----Original Message-----
From: Niki Tragen
[mailto:oracledba-ezmlmshield-x28206934.[Email address protected]
Sent: Thursday, September 30, 2004 8:57 AM
To: LazyDBA Discussion
Subject: Escaping single quotes
Hi
New to sql and trying to kill some connections. When I use the following
sql I can't seem to get the single quotes in around the sid and serial#
without syntax errors
spool killcolumbus.sql
select
'alter system kill session ' || "'"|| sid|| ',' ||serial#||';'
from v$session where username = 'COLUMBUSUN'
AND status='INACTIVE';
spool off
tried concatenating and trying to escape the ' as a special character
with \ but no luck.
Can anyone help?
cheers
Niki
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page