Well... this is not going to work... because the array will return the list, but
the sql requires commas between column names...
Are you sure this is the exact code... if the @array is in double quotes, you
should be okay..
See my little test script and results below...
#!/apps/perl/bin/perl
@array = ( 'harry','bobby','larry','louise');
print "my array: @array \n";
$sql = "select @array from mytable";
print "sql: $sql \n";
hawk:irmprod% ./test10.pl
my array: harry bobby larry louise
sql: select harry bobby larry louise from mytable
-----Original Message-----
From: David Jacobowitz [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 5:45 PM
To: [EMAIL PROTECTED]
Subject: Passing array in SELECT statement giving err.
Hello,
I have constructed an array using my table field names and trying to pass
that array in the select statement.
@inc_re = ( Hotels, Asian_Real_Estate, Smart_Buildings, Real_Estate,
Senior_Living_Homes );
$quary = "SELECT @inc_re FROM incu_real_estate LIMIT 1";
But I am getting following error.
..]$./test.pl
In string, @inc_sf now must be written as \@inc_sf at ./test.pl line 15,
near "SELECT
@inc_sf"
I have added a \ infront of the array but the quary doesn't return any
thing.
Any suggestions?
Thanks for any help.
David.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com