moony
moony

Reputation: 25

SAS pass through to Oracle to alter table

I am trying to use SAS pass through facility to alter an Oracle table and got this error:

ORACLE execute error: ORA-01735: invalid ALTER TABLE option.

Below is my code. Anybody knows what's wrong with my code? Thanks a lot in advance!

PROC SQL;

CONNECT TO oracle (user="myuserid" password="mypswd" path = "mypath") ;

EXECUTE 
(
  ALTER TABLE myschema.mytable
  ADD CONSTRAINT mytable_pk PRIMARY KEY (col_1, col_2, col_3);

) BY oracle;

QUIT;

Upvotes: 2

Views: 984

Answers (1)

Barbaros Özhan
Barbaros Özhan

Reputation: 65363

Remove ; before ) BY oracle; at the end of EXECUTE statement and make :

EXECUTE ( ALTER TABLE myschema.mytable ADD CONSTRAINT mytable_pk 
          PRIMARY KEY (col_1, col_2, col_3) ) BY oracle;

to suppress the error.

Upvotes: 2

Related Questions