executing an sql statement in perl



If this is the wong board to post this question can someone guide me
to the correct board...

I have an sql statement that is in single quotes


or $dbh->do ('update test set (mudid, date_of_last_entrym
number_of_entries) = (select mudid, max(thetime) as
date_of_last_entry, count(*) as number_of_entries from log@test l,
user@test u
where l.user = u.user
and mudid = '$a'
and thetime > sysdate - 90
group by mudid)')

where $a is defined as the id.

however i don't think it likes the 2 sets of single quotes. I have to
use single quotes as otherwise the @ symbols aren't read correctly.

The below sql statement works fine directly in my sql program (TOAD)
and this is why i think it is a perl problem:

select id, max(thetime) as date_of_last_entry, count(*) as
number_of_entries from log@test l, user@test u
where l.user = u.user
and id = 'MATT'
and thetime > sysdate - 90
group by id


any ideas?

Thanks,

.



Relevant Pages

  • Re: Escape html tags and other dangerous input
    ... The & affects the querystring. ... Single quotes can end the SQL statement allowing for a SQL ... >> injection, but that doesn't help with the ampersand, and the search page ...
    (microsoft.public.dotnet.security)
  • Re: executing an sql statement in perl
    ... number_of_entries) = (select mudid, max(thetime) as ... and thetime> sysdate - 90 ... however i don't think it likes the 2 sets of single quotes. ... The below sql statement works fine directly in my sql program ...
    (comp.lang.perl.misc)
  • Re: Handling single quotes " " in data
    ... There's no reason not to store the single quotes. ... Presumably your SQL statement is something like ... (remove the extra spaces in the parameters in the Replace statement before ... > I have been storing file locations in a table in access. ...
    (microsoft.public.access.modulesdaovba)
  • Re: executing an sql statement in perl
    ... number_of_entries) = (select mudid, max(thetime) as ... and thetime> sysdate - 90 ... however i don't think it likes the 2 sets of single quotes. ... The below sql statement works fine directly in my sql program ...
    (comp.lang.perl.misc)
  • Re: SQL and RPG
    ... the SQL statement is being called ... I don't need the semicolon token, ... ITMI in this example is 6 characters and ITP# is 18 ... If your fields are defined as character you have to put single quotes ...
    (comp.sys.ibm.as400.misc)