if this is 10g you can define your own begin and end of string delimiters...
In this example, everything between q'[ and ]' will be executed and you don't need to worry about escaping the quotes between those delimiters
begin
execute immediate q'[create table xxx as (select 1 id, decode(name,'KOST','MATCH'
end;
Main Topics
Browse All Topics





by: PlatoConsultantPosted on 2009-08-07 at 17:58:09ID: 25047812
Apostrophe/single quote in a concatenated string
If you were to concatenate an apostrophe/single quote in a string, you need to enter 4 single quotes for Oracle to display a quote symbol. For example:
SELECT 'There' || '''' || 's Henry'
FROM dual;
'create table as (select id, decode(name,'|| '''' || KOST,'|| '''' || MATCH,'|| '''' || NONMATCH,'|| '''' || ')