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");
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.