I wrote the following SQL to create a primary key on a table in an Oracle 11g database. It executes OK in TOAD:
ALTER TABLE DM_YEAR ADD CONSTRAINT DM_YEAR_PK PRIMARY KEY (YEAR_ID);
However, in Data Services when I put it in an sql function in a script in a workflow:
sql('TARGET_DS','ALTER TABLE DM_YEAR ADD CONSTRAINT DM_YEAR_PK PRIMARY KEY (YEAR_ID);') ;
It raises a database error ORA-00911… What is wrong with it please as I cannot figure out what the invalid character is - it is the same bit of sql code that works in TOAD?!? What is Data Services doing to my working sql and sending to the database?!?
18521 1 DBS-070301 03/11/2011 09:00:21 |Session JOB_PHASE1|Work flow WF_CTRL_PRELOAD_DB_WORK|Work flow WF_PRELOAD_DB_WORK
18521 1 DBS-070301 03/11/2011 09:00:21 Oracle <DEV> error message for operation <OCIStmtExecute>: <ORA-00911: invalid character
18521 1 DBS-070301 03/11/2011 09:00:21 >.
18521 1 RUN-050304 03/11/2011 09:00:21 |Session JOB_PHASE1|Work flow WF_CTRL_PRELOAD_DB_WORK|Work flow WF_PRELOAD_DB_WORK
18521 1 RUN-050304 03/11/2011 09:00:21 Function call <sql ( TARGET_DS, ALTER TABLE DM_YEAR ADD CONSTRAINT DM_YEAR_PK PRIMARY KEY
18521 1 RUN-050304 03/11/2011 09:00:21 (YEAR_ID); ) > failed, due to error <70301>: <Oracle <DEV> error message for operation <OCIStmtExecute>: <ORA-00911:
18521 1 RUN-050304 03/11/2011 09:00:21 invalid character
18521 1 RUN-050304 03/11/2011 09:00:21 >.>.
18521 1 RUN-053008 03/11/2011 09:00:21 |Session JOB_PHASE1|Work flow WF_CTRL_PRELOAD_DB_WORK|Work flow WF_PRELOAD_DB_WORK
18521 1 RUN-053008 03/11/2011 09:00:21 INFO: The above error occurs in the context <|Session JOB_PHASE1|Work flow WF_CTRL_PRELOAD_DB_WORK|Work flow
18521 1 RUN-053008 03/11/2011 09:00:21 WF_PRELOAD_DB_WORK|sql(...) Function Body|>.
18521 1 DBS-070301 03/11/2011 09:00:21 |Session JOB_PHASE1|Work flow WF_CTRL_PRELOAD_DB_WORK|Work flow WF_PRELOAD_DB_WORK
18521 1 DBS-070301 03/11/2011 09:00:21 Oracle <DEV> error message for operation <OCIStmtExecute>: <ORA-00911: invalid character
18521 1 DBS-070301 03/11/2011 09:00:21 >.
Thanks!
Darth Services (BOB member since 2007-11-20)