Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: nested dbi queries question

by philosophia (Sexton)
on Feb 02, 2005 at 00:02 UTC ( [id://427100]=note: print w/replies, xml ) Need Help??


in reply to Re^3: nested dbi queries question
in thread nested dbi queries question

here's my current code. same result still...

# begin fix loop

$sql = "SELECT * FROM sp WHERE NOT EXISTS (SELECT * FROM SP,SUPPLIER WHERE SUPPLIER.snum = SP.snum)";
$sth = $dbh->prepare($sql);
$sth->execute or die "Error: $DBI::errstr\n";

$sth->bind_col(1,\$spnum);
$sth->bind_col(2,\$snum);
$sth->bind_col(3,\$pnum);
$sth->bind_col(4,\$qty);

while($sth->fetch){

$sql2 = "INSERT INTO sp_err SELECT * FROM sp WHERE spnum = $spnum && snum = $snum";
$sth2 = $dbh->prepare($sql2);
$sth2->execute or die "Error: $DBI::errstr\n";
print "deleted row";

}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427100]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (1)
As of 2024-04-25 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found