in reply to Re: Re: Passing Arrays from Perl to Stored Procedures
in thread Passing Arrays from Perl to Stored Procedures

You would do exactly what you do when calling a subroutine in Perl: you pass it a list of arguments. Read the manual page of DBI, or whatever database interface you are using about how to pass parameters to stored procedures.

But I wouldn't do it that way. It's so.... not SQL-ish. I'd use the database's bulk copy feature to read in the CSV file into a temporary table. Then I'd modify the stored procedure to read the data from the temp table and insert it into the real table. No Perl needed, unless the database isn't able to read in a CSV file (most databases can). In which case I'd write a simple DBI program, using DBI::CVS to read in the CVS file, and DBI::whatever to write it to the temp table.

Abigail

  • Comment on Re: Passing Arrays from Perl to Stored Procedures