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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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