BookmarkSubscribeRSS Feed
arunrami
Pyrite | Level 9

Dear SASian,

 

I want to incorporate below query in SAS but I am getting syntax error due to oracle functions (get_xml) am using , can any one please guide how to overcome this.

 

proc sql;
create table record_3033 as
select owner, table_name, 
to_number(extractvalue(xmltype(dbms_xmlgen.getxml('select /*+ parallel('||table_name||',10) */   count(*) c from '||owner||'.'||table_name||' where '||owner||'.'||table_name||'.glb_oe_id = 777')),'/ROWSET/ROW/C'))
AS COUNT
  from db.all_tables
  where owner = 'DWHDWH' and table_name in (select distinct dwh_tbl_nm from db.etl_cntrl_tbl ) order by table_name;
  quit;
1 REPLY 1
LinusH
Tourmaline | Level 20

The key to this is "oracle function in SAS".

No software fully support another vendors software. If you you are using SAS, use SAS functions.

To use Oracle functions, use Oracle. From SAS this can be done using SQL explicit pass through.

Data never sleeps

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 695 views
  • 3 likes
  • 2 in conversation