Home: Perl Programming Help: DBI:
Passing array parameter to oracle stored procedure



vpahwa
Novice

Sep 7, 2009, 3:26 AM


Views: 6181
Passing array parameter to oracle stored procedure

Hi All

I need to send an array parameter to oracle stored proc from perl5

Can anyone please tell me how exactly i can achieve the same?

Regards

Vishal


1arryb
User

Sep 16, 2009, 8:58 AM


Views: 6092
Re: [vpahwa] Passing array parameter to oracle stored procedure

Hi vpahwa,

After reading up on this subject, it doesn't appear (directly) possible with DBI. What you're going to have to do, I think, is:

1. Rewrite your Oracle procedure to use delimited string parameters instead of arrays (e.g., "VALUE1|VALUE2|VALUE3..."). If you aren't allowed to re-write the procedure, you can write an adapter procedure that does the parameter conversion and calls the original procedure.

2. In perl, convert your array to a delimited string before calling the procedure. Ditto (in reverse) for output parameters.

This approach is covered at: http://www.mail-archive.com/dbi-users@perl.org/msg32055.html.

Good luck,

Larry