my $sth = $dbh->prepare("select foo1, foo2 from bar where a = ? and b = ?");
$sth->execute($a_val, $b_val);

You can also use bind_param()

Please read docs (perldoc DBI).  It is documented there very well.

Ilya

-----Original Message-----
From: Morrison Davis
To: [EMAIL PROTECTED]
Sent: 1/18/02 4:34 PM
Subject: How to use bind

Hi ALL,

  Fairly new to DBI but have managed to get an oracle 9.0.1 
data base up and running and a web application to access it.
I use:
        my $STATEMENT2 = "Insert into REPLIES values(
reply_id.nextval,
\'$REPLY\',
\'$myform{employee_id}\',sysdate,thread_id.currval,
\'$myform{toolid}\',\'$myform{iconid}\',\'$myform{category_id}\')";

        $stmt2 = $dbh->prepare($STATEMENT2);
        $stmt2->execute() or die $DBI::errstr;
        
the problem is $REPLY can hold upto 4000 characters. And today I got my
first
error string literal too long ora-1704 says to use bind variables.

How would I use bind variables to do this same command. And where is a
good place
to readup on how to use DBI bind param.
  
Thanks Morry
e-mail address: [EMAIL PROTECTED]
phone: X84792/650 786-4792 fax 650 562-2143

Reply via email to