Re: variable passed into a SQL statement from a shell script
Posted in 1998
In article <uo9sqi359GA.398@upnetnews03>, kirt_t@email.msn.com (Kirt)
wrote:
> I am trying to pass a variable array for my table names following a
> "from"
> and passing a variable in the middle of a wildcard like or matches
> statement
> i.e.. where description like "%variable%"
>
> when I try to pass the array $table_array[r] I get an unrecognized
> character
> message
> as for the where like I get no rows found when I replace the variables
> with
> constant the statement work fine if anyone can help please do
>
> thanks in advance
>
>
>
Something like this should work
dbaccess database <<-EOF
select *
from table
where col1 like "%${table_array[${r}]}%"
EOF
Paul Watson # I don't suffer from
WF Software Ltd. # stress, I'm just
Tel. (+44) 1436 674729 # a carrier
Fax. (+44) 1436 678693 #
www.wfsoftware.co.uk