Ben Siders wrote:
I am parsing some XML and trying to write the tags to a table. Here is the table (PostgreSQL):
Column | Type | Modifiers
-----------+---------+-----------
id | integer |
ref_id | text |
ref_table | text |
tag | text |
seq | integer |
Here is the code where I try to write to the table:
my $CreateMarkup = <<EOF;
insert into markup (id, ref_id, ref_table, tag, seq) values (:1, :2, :3, :4, :5);
EOF
my $mch = $dbw->prepare($CreateMarkup);
$mch->bind_param(1, $serialID{MarkupId} );
$mch->bind_param(2, $el->{parent_seq});
$mch->bind_param(3, $el->{parent_table});
$mch->bind_param(4, $el->{tag});
$mch->bind_param(5, $parent->{count});
$mch->execute();
Simple enough, right? I put in some debugging to print out what it's trying to do. If the second parameter is 'struct__APIDocStruct_1m0', it fails with this error:
DBD::Pg::st execute failed: ERROR: pg_atoi: error in "struct__APIDocStruct_1m0": can't parse "struct__APIDocStruct_1m0" at /usr/cms/bsiders/sourcedb/bin/ParseSingleSchemaXml.pl line 946
If the second parameter, however, is 'axes_8h_1a0' it works jsut fine. The field is just text. Why does one random string work and another fail?
------------------------------------------------------------------------
Subject:
Weird problem with writing to PostgreSQL through DBI
From:
Ben Siders <[EMAIL PROTECTED]>
Date:
Wed, 29 Jan 2003 14:35:30 -0600
To:
[EMAIL PROTECTED]
I am parsing some XML and trying to write the tags to a table. Here is the table (PostgreSQL):
Column | Type | Modifiers
-----------+---------+-----------
id | integer |
ref_id | text |
ref_table | text |
tag | text |
seq | integer |
Here is the code where I try to write to the table:
my $CreateMarkup = <<EOF;
insert into markup (id, ref_id, ref_table, tag, seq) values (:1, :2, :3, :4, :5);
EOF
my $mch = $dbw->prepare($CreateMarkup);
$mch->bind_param(1, $serialID{MarkupId} );
$mch->bind_param(2, $el->{parent_seq});
$mch->bind_param(3, $el->{parent_table});
$mch->bind_param(4, $el->{tag});
$mch->bind_param(5, $parent->{count});
$mch->execute();
Simple enough, right? I put in some debugging to print out what it's trying to do. If the second parameter is 'struct__APIDocStruct_1m0', it fails with this error:
DBD::Pg::st execute failed: ERROR: pg_atoi: error in "struct__APIDocStruct_1m0": can't parse "struct__APIDocStruct_1m0" at /usr/cms/bsiders/sourcedb/bin/ParseSingleSchemaXml.pl line 946
If the second parameter, however, is 'axes_8h_1a0' it works jsut fine. The field is just text. Why does one random string work and another fail?
-- Benjamin J. Siders Software Engineer
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]