I just did some testing. Your SQL is SELECT ... IN 1 2 3 That's syntactically incorrect.
Bong Tumanut DBA --- "Ho, Tony" <[EMAIL PROTECTED]> wrote: > Hi Bong > That's correct. > Tony > > -----Original Message----- > From: Bong Tumanut [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 11, 2002 1:24 PM > To: Ho, Tony; '[EMAIL PROTECTED]' > Subject: Re: DBI with arrays assigned in SQL > > > 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 > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com