sqlplus (concatenation single quotes)
I am building some DML statements from a query. This query contains
a where clause whose values I need to encapulate in single quotes.
The current query:
select 'delete from OPS\$ORACLE.object_baseline where
owner = ' || owner || ' and object_name = ' || object_name || '
and table_name = '|| table_name || ' and column_name = ' || column_name from
(select owner,object_name,table_name,column_name from object_baseline where owner=upper('${OWNER}')
minus
select owner,a.index_name,a.table_name,column_name from
dba_indexes a,dba_ind_columns b where a.index_name=b.index_name
and owner=upper('${OWNER}') and a.table_name not like 'SYS%')
The current output:
delete from OPS$ORACLE.object_baseline where owner = YYY and object_name = XXX_PK and table_name = XXX and column_name = ID
I want to encapuslate the values 'YYY', 'XXX_PK', 'XXX' and 'ID' within
single quotes. I tried tried many different combinations and I am unable
to get this to work. Can someboody please provide an example.
Thanks to all who answer