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!

Specifying a default for plsql varchar2 table type

698126Jul 22 2009 — edited Jul 22 2009
Hi there

I'm using mod plsql to update a database tabe from an html form. The form has a matrix of checkboxes which I'm passing into a procedure as varchar2 table types. The problem I get is that it gives me an error if one of the check boxes on a row is null (NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM) as it's not passing anything for that parameter in the procedure. My procedure is defined as:

PROCEDURE add_items (in_article_id IN NUMBER DEFAULT NULL
,in_related_id IN varchar2_table
,in_relate IN varchar2_table
,in_section IN varchar2_table
,in_preview IN varchar2_table
,in_session_id IN NUMBER) IS

where in_relate , in_section and in_preview are the parameters that the check boxes relate to. My form has the following inputs:

<FORM name="related_results" action="ce_related.add_items_table" method="post">
<input name="in_article_id" type="hidden" value="'||in_article_id||'">
<INPUT type=hidden name="in_session_id" value="'||in_session_id||'">
<input name="in_related_id" type="hidden" value="'||v_article.article_id||'">
<input name="in_relate" value="1" type="checkbox">
<input name="in_section" value="6" type="checkbox">

I have tried adding a 'DEFAULT NULL' clause to the procedure parameter, but this gives the error 'Error(356,62): PLS-00382: expression is of wrong type'. I have also tried using the owa_util.ident_arr datatype, but this doesn't work either. Has anyone got any ideas?

Cheers, Kate
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 19 2009
Added on Jul 22 2009
4 comments
1,669 views