|
|
sybperl-l Archive
Up Prev Next
From: "Colm O' Flaherty" <colm_o_flaherty at hotmail dot com>
Subject: Re: Calling a Stored Procedure with 30 parameters
Date: Feb 17 2000 6:42PM
Worst case, u could create the call to ct_param into a string using a loop,
and then eval the string. U can even change the number of parameters this
way.
Although, I'm sure someone else will will come up with something far nicer!
Colm
> >Wei Liu writes:
> > > I'm using the CTlib for calling a stored procedure with 30
> > > parameters. All these 30 params are of the same type and passed from
>an
> > > array of strings. Is there any way that I can use a loop to go thru
>each
> > > param instead of sending the param via $dbh individually 30 times?
>Thanks!
> >
> >How do you set the params at the moment?
> >
> >Do you use the ct_param() call?
> >
> >Michael
> >--
> >Michael Peppler -||- Data Migrations Inc.
> >mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
> >Int. Sybase User Group -||- http://www.isug.com
> >Sybase on Linux mailing list: ase-linux-list@isug.com
>
>
>Yes, indeed like this:
>
>$d->ct_param({name => '@arg_str1',
> datatype => CS_CHAR_TYPE,
> status => CS_INPUTVALUE,
> value => $arg_str[0],
> indicator => CS_UNUSED});
>
>
>Now that I have @arg_str1 to @arg_str30 and they are the 30 elements of an
>array @arg_str. What I am thinking is that using the above ct_param()
>individually 30 times for these 30 params, though worked perfectly, may
>seem a bit too much repetition. I have tried to use a loop by omitting the
>'name' in above ct_param() call but only got an error msg.
>
>Thanks for the help.
>
>Wei
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
|