Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: DBI error

by ralphie (Friar)
on Dec 01, 2003 at 10:46 UTC ( [id://311283]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to DBI error

the dbi prepare method is for preparing a statement handle to which one passes values at execution. in your case, i would expect to see something like ...
my $sthD = $dbh->prepare("INSERT into ICD_specifications_for_disea
+se (Range_key, A, B, C, D, E, F, G) VALUES (?,?,?,?,?,?,?);
then you execute the statement with
$sthD->execute(19,'E',9,'430','438');
for example. You can execute a large statement like this, but that would be done with the do() method.

Replies are listed 'Best First'.
Re: Re: DBI error
by cchampion (Curate) on Dec 01, 2003 at 11:18 UTC

    You are just repeating the same mistake the OP did, i.e. naming eight columns and then passing 5 values.

    Moreover, the "prepare" method can work just fine without placeholders. It allows placeholders, but it does not enforce them.

    I can't see where the error is, but I am sure the reason is not the one you mentioned.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://311283]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.