I have a the query below that I am reading from a file and placing in the $sql variable. i.e. [snipet]---reads any query in a file to the variable $sql if (open(FOURDAYQ, $fourdayquery)){ while (<FOURDAYQ>){ chomp(@myquery=<FOURDAYQ>);} close(FOURDAYQ); return "@myquery"; } else { die open(ERRORLOG, ">>$errorlog") && print ERRORLOG "\n$process_date\nQuery is not available\n"; return 0;} When I get the query into the variable, I try to prepare it using $sth=$dbh->prepare($sql); It is failing and I am not sure why. When I place the query into the variable by assignment it works. As long as i first assign the variable, then all is good. [snipet]-----Assignment i.e. $sql = qq(select p.ban "BAN", (s.subscriber_no) "Ported Number", n.last_business_name "CONSUMERLNAME", n.first_name "CONSUMERFNAME", b.account_type, c.carrier_name "Service Provider", p.sys_creation_date "Initiation Date of the Request"
I would like to have a [erl script that will read any SQL query from a file given to it and then run the query from within the perl script. Any ideas? Thanks, JC