DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Jul 2006

    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}')
    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
    Last edited by BeefStu; 02-09-2011 at 08:27 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.