BookmarkSubscribeRSS Feed
kuppusamy
Fluorite | Level 6

the below bolded text is the logic. inthat im getting this error.

 

proc sql feedback;
connect to &db_engine as &db_engine (authdomain=&ecm_dbauth &ecm_db_conopts.);
execute (
merge into party_live pl
using
(select party_rk, version_no, party_full_nm, valid_from_dttm from iem_party_staging) tmp_iem
on (tmp_iem.party_rk = pl.party_rk)
when matched then update set
pl.version_no = tmp_iem.version_no,
pl.valid_from_dttm = tmp_iem.valid_from_dttm,
pl.party_full_nm = tmp_iem.party_full_nm
%if %upcase(&db_engine) eq ODBC %then %do;
;
%end;
) by &db_engine;
disconnect from &db_engine;
quit;

 

 

SYMBOLGEN: Macro variable DB_ENGINE resolves to oracle
MPRINT(FCF_IEM_UPDATE_SUBJECT):

execute ( merge into party_live pl using (select party_rk, version_no, party_full_nm,
valid_from_dttm from iem_party_staging) tmp_iem on (tmp_iem.party_rk = pl.party_rk) when matched then update set pl.version_no =
tmp_iem.version_no, pl.valid_from_dttm = tmp_iem.valid_from_dttm, pl.party_full_nm = tmp_iem.party_full_nm ) by oracle;
ERROR: ORACLE execute error: ORA-30926: unable to get a stable set of rows in the source tables.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
SYMBOLGEN: Macro variable DB_ENGINE resolves to oracle
MPRINT(FCF_IEM_UPDATE_SUBJECT): disconnect from oracle;

 


NOTE: Statement not executed due to NOEXEC option.
MPRINT(FCF_IEM_UPDATE_SUBJECT): quit;

4 REPLIES 4
kuppusamy
Fluorite | Level 6

i modified to distinct party_rk. it is not working.......can you edit above code..

Kurt_Bremser
Super User

@kuppusamy wrote:

i modified to distinct party_rk. it is not working.......can you edit above code..


I can't test anything, as I do not have Oracle, I only have SAS and google 😉 . I suggest you get hold of one of your local Oracle DBA's to check your code.

SuryaKiran
Meteorite | Level 14

Hi,

 

Is iem_party_staging temporary table? How did you create that temp table? Temp tables in DBMS exists only for that particular session. You need to setup connection in such a way that multiple DATA steps and PROC steps share the same connection. This can be done by using CONNECTION=GLOBAL. 

If your creating the temp table in one pass-through statement and accessing in other pass-through statement will not wok if you don't mention connection=Global. 

 

/* Run this and see if your temp table actually exists */

 proc sql;
connect to &db_engine as &db_engine (authdomain=&ecm_dbauth &ecm_db_conopts.);
CREATE TABLE temp AS 
SELECT * 
FROM CONNECTION TO &db_engine 

 (Select  * from iem_party_staging);

DISCONNECT FROM &db_engine;
QUIT;

 

Thanks,
Suryakiran

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 3747 views
  • 0 likes
  • 3 in conversation