MySQL Forums
Forum List  »  Perl

UPDATE not working from code, no error
Posted by: mattia parigiani
Date: April 16, 2008 10:09AM

Hi Folks,

This is my first post on MySQL forums.
I have a snippet of perl code that is executing an UPDATE on a single table row and its not working.
Its not giving any errors as well and if I print the query to browser and paste it into Query Browser, execute it, it works perfectly..
This is the snip:

$q1= "UPDATE clz_task SET serialized_operations=\"$perl\" WHERE id='$new_task_id'";
#$q1 = "UPDATE clz_task SET data_path=\"merda\" WHERE id='$new_task_id'";
print "<br />" . $q1 . " <br />";
$dbh = DBI->connect($connectionInfo,$userid,$passwd);
$sth = $dbh->prepare($q1);
$sth->execute();
$dbh->disconnect();

The $perl variable contains a pretty big perl associative array (also with sub associative arrays in it) and the data type of the column "serialized_operations" is TEXT (but I also tried with LONGTEXT and VARCHAR(2048): nothing happens in this cases as well)


The $perl variable I obtain from the associative array by using the App package for Perl which allows serialization of perl variables to strings. I also tried by not using this and b y simply just using the Dumper Perl package to write the variable in a string... Nothing to do, I am going crazy, cant believe it does it in Query Bowser but not from CGI.

This is the type of string I am trying to insert (with UPDATE), just for you to understand..

"$data = { '4' => [ { 'id_lib' => '2', 'help_text' => undef, 'use_bands' => [ '1', '10', '11', '12', '13', '14', '15', '2', '3', '4', '5', '6', '7', '8', '9' ], 'perform_op' => 'yes', 'id_level' => '4', 'op_name' => 'Reproject', 'op_id' => '42', 'cmd_maps' => [ { 'token_map' => [ { 'html' => '
Or create a new CRS: click here
', 'value' => '1', 'name' => 'dest_crs', 'label' => 'Destination CRS', 'description' => 'Choose a destination CRS for reprojection', 'token' => 'DEST_CRS' } ], 'cmd_map' => ' gdalwarp SRC_CRS DEST_CRS FILE_IN FILE_OUT ', 'sub_op_order' => '1' } ] } ], '3' => [ { 'id_lib' => '2', 'help_text' => undef, 'use_bands' => [ '1', '10', '11', '12', '13', '14', '15', '2', '3', '4', '5', '6', '7', '8', '9' ], 'perform_op' => 'yes', 'id_level' => '3', 'op_name' => 'Insert GCPs', 'op_id' => '41', 'cmd_maps' => [ { 'token_map' => [], 'cmd_map' => 'cat gcps >> insertgcps; ', 'sub_op_order' => '1' }, { 'token_map' => [], 'cmd_map' => 'echo SPACE FILE_IN FILE_OUT >> insertgcps', 'sub_op_order' => '2' }, { 'token_map' => [], 'cmd_map' => 'chmod 755 insertgcps', 'sub_op_order' => '3' }, { 'token_map' => [], 'cmd_map' => './insertgcps', 'sub_op_order' => '4' }, { 'token_map' => [], 'cmd_map' => 'rm insertgcps', 'sub_op_order' => '5' } ] } ], '2' => [ { 'id_lib' => '1', 'help_text' => undef, 'use_bands' => [ '1', '10', '11', '12', '13', '14', '15', '2', '3', '4', '5', '6', '7', '8', '9' ], 'perform_op' => 'yes', 'id_level' => '2', 'op_name' => 'IPW Destripe', 'op_id' => '37', 'cmd_maps' => [ { 'token_map' => [], 'cmd_map' => ' tifftopnm FILE_IN > FILE_OUT_PNM ', 'sub_op_order' => '1' }, { 'token_map' => [], 'cmd_map' => ' pbm2ipw FILE_IN_PNM > FILE_OUT_IPW ', 'sub_op_order' => '2' }, { 'token_map' => [ { 'html' => '
Or Create a new Kernel click here ', 'value' => '6', 'name' => 'kernel', 'label' => 'Please Choose a kernel for this operation', 'description' => undef, 'token' => 'KERNEL' } ], 'cmd_map' => ' convolve -i FILE_IN_IPW -c KERNEL > FILE_OUT_IPW ', 'sub_op_order' => '3' }, { 'token_map' => [], 'cmd_map' => ' ipw2pbm FILE_IN_IPW > FILE_OUT_PNM ', 'sub_op_order' => '4' }, { 'token_map' => [], 'cmd_map' => ' gdal_translate FILE_IN_PNM FILE_OUT ', 'sub_op_order' => '5' } ] }, { 'id_lib' => '3', 'help_text' => undef, 'use_bands' => [ '1', '10', '11', '12', '13', '14', '15', '2', '3', '4', '5', '6', '7', '8', '9' ], 'perform_op' => 'yes', 'id_level' => '2', 'op_name' => 'Equalize', 'op_id' => '39', 'cmd_maps' => [ { 'token_map' => [], 'cmd_map' => ' convert FILE_IN -equalize FILE_OUT ', 'sub_op_order' => '1' } ] } ] }; "


I am unsure on how to fix this prob, please help

Options: ReplyQuote


Subject
Written By
Posted
UPDATE not working from code, no error
April 16, 2008 10:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.