SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tommy81
Obsidian | Level 7

Hi ,

Need some advice on which type of methods can be used to efficiently and quickly delete a couple million rows in Oracle from SAS.

 

Some errors see during the course of action below.

Error received on SAS - “ERROR: Update/delete failed. The observation may have been changed or deleted since the time it was read. ORACLE execute error:

       ORA-08177: can't serialize access for this transaction.

ERROR: ROLLBACK issued due to errors for data set XYZ

NOTE: Deletes were rolled back by the DBMS software.”

1 ACCEPTED SOLUTION

Accepted Solutions
tlk
Quartz | Level 8 tlk
Quartz | Level 8

Hi,

 

You can use a Proc SQL:

 

Proc sql;

connect to oracle(user=yourusername pass=yourpass path=bd);

execute (truncate table yourtable)

by oracle;

quit;

 

Laurent

View solution in original post

2 REPLIES 2
tlk
Quartz | Level 8 tlk
Quartz | Level 8

Hi,

 

You can use a Proc SQL:

 

Proc sql;

connect to oracle(user=yourusername pass=yourpass path=bd);

execute (truncate table yourtable)

by oracle;

quit;

 

Laurent

LinusH
Tourmaline | Level 20

Do you want to delete tables, or rows in tables?

If you have the appropriate rights, drop table would work, can't see if you can optimize that.

If you want to delete rows effectively, that's more of an Oracle DBA question. Once you know the Oracle syntax, you might want to discover of you can achieve that using implicit SQL pass-thru from SAS.

Data never sleeps

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 2 replies
  • 9522 views
  • 1 like
  • 3 in conversation