PL/SQL (MOSC)

MOSC Banner

EXECUTE IMMEDIATE returns wrong record-count.

in PL/SQL (MOSC) 7 commentsAnswered

I have a process where dynamic-sql is more advantageous than parametric DML statements.

In a package, I created DML-scripts (UPDATE ....) and store them in a table including the number of records that would be updated. Once I have all my scripts created, I execute them all using "EXECUTE IMMEDIATE xx-script" individually so that I can compare the number of records updated and the stored count of the number of records. After "EXECUTE IMMEDIATE xx-script" I use "upd_rec_cnt := SQL%ROWCOUNT" to store the number of records that have been updated. Thus I can compare the actual with the expected number of updated records to validate my update.

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center