Escaping single quotes

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


Oracle LazyDBA home page