Below code works fine for most of the cases. It blows up when LIB_SEGCO has any single quotes such as ABC'DEF
In these cases it gives error ORA-00917: missing comma
req := 'INSERT INTO CLIENTS(
IDEVT,
ID_CLIENT,
CATEGORIE_CLIENT,
SEGCO,
LIB_SEGCO,
NOM,
ADRESSE,
CODE_POSTAL,
VILLE,
PAYS,
STATUT)
values(''' || UNID ||''','''||ID||''','''||SEGCO||''','''||L_SEGCO ||''','''||**LIB_SEGCO** ||''','''|| NOM||''','''||
ADRESSE||''','''||CODE_POSTAL||''','''||cVILLE||''','''||PAYS||''','''||CODE_STATUT||''')';
execute immediate req;
Any ideas to escape the apostrophe when it passed in variable?
Thanks