I'm a Perl newbie but are you generating the SQL such that it is
syntactically
SELECT... IN (1,2,3)
?

Bong Tumanut
DBA

--- "Ho, Tony" <[EMAIL PROTECTED]> wrote:
> Hi guys
> I was wondering if you could help me.
> 
> In my Perl code, I declare an array, say @some_array.
> I later open a file with a column of numbers i.e.
> 1
> 2
> 3
> .
> and assign these values the array using the unshift command.
> i.e. 
> while (<..>) {
>      unshift(@some_array, $_);
> }
> 
> I would like to use the values in the array inside an SQL statement
> prepared
> by DBI as follows:
> 
>      $get_reject_numbers = "create view $view_get_reject_accounts as
>                                          select
>                                          ACCOUNT
>                                          from ACCOUNTS
>                                          where ACCOUNT not in
> @some_array";
> 
>      $sth = $dbh->prepare($get_reject_numbers);
>      $sth->execute;
> 
> I am currently getting an error with this SQL statement and I am
> assuming it
> is because of the way that the array "some_array" is assigned to
> ACCOUNT.
> 
> I would be most grateful for any advice.
> Thanks in advance
> Tony
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Reply via email to