Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^7: fetchrow_array loop in perl 5.10

by mje (Curate)
on Sep 19, 2014 at 08:38 UTC ( #1101170=note: print w/replies, xml ) Need Help??


in reply to Re^6: fetchrow_array loop in perl 5.10
in thread fetchrow_array loop in perl 5.10

You look to be deleting, inserting and fetching from the same table at the same time and this does not seem to coincide with the code you first showed us. Can we see the actual code that produced that trace.

Replies are listed 'Best First'.
Re^8: fetchrow_array loop in perl 5.10
by Anonymous Monk on Sep 19, 2014 at 08:46 UTC
    the delete is from the start of the program, which is I think don't matter as even if I comment out the delete part, the loop would still not finish all rows returned.
      my $sth; my $row; my $newAssetBlockId = 13453; my $assetDelSql = "DELETE FROM nl_asset WHERE asset_block_id = ? +"; my $assetDelStmt = $dbh->prepare($assetDelSql); $assetDelStmt->execute($newAssetBlockId); $assetDelStmt->finish; my $assetInsSql = "SELECT asset_id, field_name, mime_type, text_a +sset, clob_asset, blob_asset, status, add_user FROM nl_asset WHERE asset_block_id = ? and status = ? order b +y field_name desc"; my $assetInsStmt = $dbh->prepare($assetInsSql); my $assetInsertSql = "insert into nl_asset (asset_id, asset_block_id, + field_name, text_asset, clob_asset, blob_asset, mime_type, add_user, + add_dttm, status) values (next value for NL_ASSET_SEQ, ?, ?, ?, ?, ? +, ?, ?, current timestamp, ?)"; my $assetInsertStmt = $dbh->prepare($assetInsertSql); $assetInsStmt->execute(12959, 'A'); while (my ($assetId, $fieldName, $mimeType, $textAsset, $clobAsset +, $blobAsset, $status, $addUser) = $assetInsStmt->fetchrow_array()) { dme::log_msg("assetId with $fieldName"); $assetInsertStmt->execute($newAssetBlockId, $fieldName, $textA +sset, $clobAsset, $blobAsset, $mimeType, $addUser, $status); dme::log_msg($dbh->errstr) if ($dbh->errstr); dme::log_msg("done with $assetId"); }

      So show us the real code that produced that trace.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2019-05-22 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (138 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!