Reputation: 23
I am trying to execute below query in toad.
UPDATE rd_catg_sync_tables
SET RCST_SYNC_COL2='Insert into ASM_ACE_SERVICE
(SERVICE_ID, SERVICE_NAME, SERVICE_DESC, SERVICE_LEVEL, SERVICE_CODE, SERVICE_CREATED_DATE, SERVICE_TYPE, SERVICE_REF_TBL,ASM_SC_CATGID,ASM_SC_MODIFIED_BY)
Values
(?, '?', '?', ?, '?', TO_DATE('?', 'MM/DD/YYYY HH24:MI:SS'), '?', '?','?','?');'
WHERE RCST_TABLE_NAME=ASM_ACE_SERVICE
But when I run it's asking values for MI:SS
. But it's a part of data which I need to insert into the RCST_SYNC_COL2. Kindly someone help me how to insert this data into that coloumn.
Upvotes: 0
Views: 56
Reputation: 1269953
You need additional quoting. To escape a single quote in SQL, use two single quotes in a row:
update rd_catg_sync_tables
set RCST_SYNC_COL2 = '
Insert into ASM_ACE_SERVICE(SERVICE_ID, SERVICE_NAME, SERVICE_DESC, SERVICE_LEVEL, SERVICE_CODE, SERVICE_CREATED_DATE, SERVICE_TYPE, SERVICE_REF_TBL,ASM_SC_CATGID,ASM_SC_MODIFIED_BY)
Values
(?, ''?'', ''?'', ?, ''?'', TO_DATE(''?'', ''MM/DD/YYYY HH24:MI:SS''), ''?'', ''?'',''?'',''?'');'
where RCST_TABLE_NAME = 'ASM_ACE_SERVICE'
I don't know how you are going to execute the subquery, but the single quotes around the place holders (?
) and the semicolon at the end are probably unnecessary.
Upvotes: 1