Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

understanding dynamic sql space allocation

12208Feb 6 2007 — edited Feb 6 2007
Hi --

I am trying to understand how space allocation works in Oracle for the following stored procedure snippet.

...
v_sql varchar2(250);
...
v_sql :=
'UPDATE AGI.WebCertifyBatch W
SET W.selected = 0
WHERE W.webuserid = :webuserid and W.applicationid in
( SELECT * FROM THE ( SELECT CAST( in_list(:deselectedapplist) as myTableType ) from dual ) )';

EXECUTE IMMEDIATE v_sql USING v_webuserid, v_deselectedapplist;


v_webuserid is a 10-15 digit id.
v_deselectedapplist is a dynamic list of 6-8 digit application ids.

I ran a stored procedure containing this code, passing in a list of 100 ids in the v_deselectedapplist paramter (6-8 digits long, comma separated - 700-900 characters in length). I expected a runtime exception to occur but it did not and the data was updated correctly.

If I allocate only 250 characters of space in my v_sql variable and pass more than enough value in the dynamic 'in' list to make it larger than the allocated 250 characters, how is it that no runtime exception occurs? My guess is that bind variables have something to do with this.

Could someone help me understand so I can explain this to my client?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2007
Added on Feb 6 2007
3 comments
485 views