Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Arrays + PL/SQL Gatewar Flexible Parameter Passing

Re: PL/SQL Arrays + PL/SQL Gatewar Flexible Parameter Passing

From: mcstock <mcstockspamplug_at_spamdamenquery.com>
Date: Sun, 23 Nov 2003 07:25:01 -0500
Message-ID: <Vc2dnRQhhJCvOl2iRVn-gQ@comcast.com>


"John Russell" <netnews8_at_johnrussell.mailshell.com> wrote in message news:u4b0svsjo43n3g4u9mumbbhjuli0cn5299_at_4ax.com...
| >>>I'm not sure I like this solution since anybody could screw with that
| >>>variable and change the default behavior of that procedure in their
| >>>session. However, that might actually be desirable in some situations.
| >>
| >>
| >> I ran into the same problem, with the same solution. To avoid
| >> problems from other code changing the variable, you could declare
| >> empty_numarray as a constant within the package.
| >
| >I don't see how this will work. When you try to make it a constant,
| >it's going to require an initialization. That puts us right back to the
| >original problem as far as I can see. Namely, how do you write a value
| >declaration for an index by array?
|
| I was going from memory, didn't have the source I used. I believe
| what I actually did was to make a packaged function that returned an
| uninitialized nested table, and called that in the initialization
| clause, either for a constant nested table in the package, or in a
| DEFAULT clause on a parameter.
|
| The situation I had was a web form containing several checkboxes, all
| with the same name. The PL/SQL procedure that processes the results
| from this form gets a nested table with an arbitrary number of
| VARCHAR2s. No problem if the user selected 1 or more checkboxes. But
| if they didn't select any, the procedure doesn't receive anything for
| that parameter and will throw an uncatchable exception. Unless
| there's a DEFAULT clause on the parameter, and that's where a packaged
| function returning an uninitialized nested table comes in.
|
| John
| --
| Photo gallery: http://www.pbase.com/john_russell/

an observation: the situation you describe is a good case for using the 'flexible parameter passing' when using the PL/SQL Gateway -- all parameters are passed via 2 PL/SQL arrays, one of names, one of values Received on Sun Nov 23 2003 - 06:25:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US