Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Passing Arrays from Perl to Stored Procedures

by OM_Zen (Scribe)
on Mar 07, 2003 at 18:05 UTC ( [id://241212]=note: print w/replies, xml ) Need Help??


in reply to Passing Arrays from Perl to Stored Procedures

Hi ,

The backend stored procedure , HOW can a stored procedure accept an array first .You are thinking of passing an array to stored procedure , but how iwll a stored procedure accept it The procedure written like

CREATE OR REPLACE PROCEDURE (?????(the array cannot be used ) IN) + as You can only use CREATE OR REPLACE PROCEDURE (v_scalr_in IN) as


Hence trying to pass an array to a stored procedure which can never accept an array is not how it could be working

That you could do is concatenate the scalar values into a single scalar value in perl and then send it to the Orcale stored procedure and then parse it with substr inside the oracle procedur and use it like

my $a; foreach (@arrayofvariables){ $a .= $_; } my $proc_run = "BEGIN run_proc(:1) END\;" # then bind it with $a


The stored procedure has to

CREATE OR REPLACE PROCEDURE ( v_scalar_in IN VARCHAR) AS here you have to substr with the index of "," and then send it i +n for loop for your processing


The idea of sending arrays to stored procedures is not that good in that stored procedures , I mean the databases do not have these array only the table and record type , mya be try using those

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://241212]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-03-28 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found