insert into statement problem

From: Kaustubh Shinde (shindekaustubh_at_hotmail.com)
Date: 07/30/04


To: dbi-users@perl.org
Date: Fri, 30 Jul 2004 08:35:13 +0000

Hi,
I have been trying to read data from a hash and put it into myaql using
insert into statement.

foreach $key (keys %submt_feat)
{
    if($submt_feat{$key}){
        $submt_feat{$key}= $submt_feat{$key};
        push(@sbft,$key);
        push(@sbval,$submt_feat{$key});
    }
}
$temfeat = "(".join(",",@sbft).")";
$temval = "(".join(",",@sbval ).")";
$ins = "insert into submitter ";
$statement = $ins.$temfeat." values ".$temval.";";
$statement = $dbh->prepare($statement);
$statement->execute();

but it doesnt work because the values need quotes around them since its
varchar type.
i am not able to get quotes around them. This is very urgent and I will
really really appreciate any ideas.
Thank you,
Kaustubh

_________________________________________________________________
Studies, career, romance. Whatever your concerns.
http://www.astroyogi.com/newMSN/ We have the answers.



Relevant Pages

  • Re: matching the network segment but cant work :-(
    ... By putting $domip in single quotes, ... you're checking the value of the hash at the literal string '$domip', ... Remove those quotes. ... only incrementing the value of the hash key if it's already greater than ...
    (comp.lang.perl.misc)
  • Re: Passing hash to another script via commandline
    ... into a string representing the hashes structure? ... characters like double quotes) would cause probs when the string is pulled ... pipe the serialised version of the hash between the two ... All that the callee program needs to know is the ...
    (comp.lang.perl.misc)
  • Re: insert into statement problem
    ... Helck, Timothy wrote: ... >but it doesnt work because the values need quotes around them since its ... >i am not able to get quotes around them. ...
    (perl.dbi.users)
  • Re: hashes
    ... > BTW, I switched to using CGI.pm, in case that was my problem. ... > using POST method. ... > Why does adding double quotes to the print of the hash result change ...
    (comp.lang.perl.misc)
  • Re: how to include special characters in a formula?
    ... > I have tried the suggestion below, but it still doesnt work. ... >> Use double quotes instead of apostrophes. ... >> Pearson Software Consulting, LLC ...
    (microsoft.public.excel.programming)