BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tborange
Fluorite | Level 6

Greetings,

I'm on SAS 9.4 and trying to use OR_IDENTITY_COLS to Use Oracle Sequence when loading a table. The documentation @ https://go.documentation.sas.com/?docsetId=acreldb&docsetTarget=n17merknv57i0un1vhszwcwbzab9.htm&doc... is vague.

Has anyone used this. If so, can you provide an example

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
tborange
Fluorite | Level 6

SAS Tech Support provided the answer:

Note: That if you're using another Oracle schema's sequence, you need to add it as follows.

'{Schema Name Here}.TEST_SEQ.NEXTVAL' 

Here is an example:

 

DATA TEST_IMPORT;

INPUT LOC_NM $;

DATALINES;

EIN

BVN

TST

RUN;

 

*NWDWLIB is a macro variable with the string of connecting to one of our Oracle DBs;

LIBNAME &NWDWLIB;

PROC SQL;

INSERT INTO NWDWLIB.TEST_LOC

(OR_IDENTITY_COLS=(DW_TEST_LOC_ID='TEST_SEQ.NEXTVAL'),DW_TEST_LOC_ID,LOC_NM)

SELECT  ., LOC_NM

FROM WORK.TEST_IMPORT;

QUIT;

 

LIBNAME NWDWLIB CLEAR;

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

One for tech support I reckon. I couldn't find a syntax that worked as intended.

tborange
Fluorite | Level 6

HI Chris,

Thanks for your opinion.

I was able to get it to work syntactically. However, the sequence # didn't flow through to the Oracle table.

I'll contact my company's tech support rep and update this thread accodringly.

Thanks again.

Troy

tborange
Fluorite | Level 6

SAS Tech Support provided the answer:

Note: That if you're using another Oracle schema's sequence, you need to add it as follows.

'{Schema Name Here}.TEST_SEQ.NEXTVAL' 

Here is an example:

 

DATA TEST_IMPORT;

INPUT LOC_NM $;

DATALINES;

EIN

BVN

TST

RUN;

 

*NWDWLIB is a macro variable with the string of connecting to one of our Oracle DBs;

LIBNAME &NWDWLIB;

PROC SQL;

INSERT INTO NWDWLIB.TEST_LOC

(OR_IDENTITY_COLS=(DW_TEST_LOC_ID='TEST_SEQ.NEXTVAL'),DW_TEST_LOC_ID,LOC_NM)

SELECT  ., LOC_NM

FROM WORK.TEST_IMPORT;

QUIT;

 

LIBNAME NWDWLIB CLEAR;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1323 views
  • 0 likes
  • 2 in conversation