I'm having some variable problem in conjunction with DBI...
What is happening is that I'm using a variable called $mainsearch that i get from the user in a form GET and it taking it in and making $mainsearch (you will see below)...But when I do a select in Oracle (using DBI) the first statement uses the variable and it seem that the variable 'loses its data' which means the rest of the statments dont bring up the right stuff...Maybe someone can help me out, tell me what im doing wrong. Basically here are my code snippets:
my %incoming = &read_input; # Read information into associated # array %incoming. my $mainsearch = $incoming{'yoursearch'}; # Fetch the text from the array. my $maintable = $incoming{'yourtable'}; # Fetch the text from the array. #Start DBI my $dbh = DBI->connect("dbi:xxxxxxxxxxx", "xxxxxxx", "xxxxxxxx"); my $st = $dbh->prepare(" select * from ( select * from qatest where ser_app_name like upper('%$mainsearch%') or att_data like upper('%$mainsearch%') or mrserver like upper('%$mainsearch%') or owner_user like upper('%$mainsearch%') or lan_serv like upper('%$mainsearch%') or s_contact like upper('%$mainsearch%') or s_provider like upper('%$mainsearch%') or prod_deliv like upper('%$mainsearch%') order by ser_app_name ASC ) where rownum < 31 "); $st->execute();
Please someone give me some insight ive been looking on google and perl sites all day with no resolution in-sight!
>>>UPDATE: I cant figure out how to format on this website, I cant seem to put line breaks in :(
20070124 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
In reply to Perl DBI / Variable Question by Trihedralguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |