Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Passing Arrays from Perl to Stored Procedures

by OM_Zen (Scribe)
on Mar 07, 2003 at 18:05 UTC ( #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


Comment on Re: Passing Arrays from Perl to Stored Procedures
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-12-28 11:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (180 votes), past polls