Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Table BTEST is defined as followsuse DBI; my ($dbh, $data) = (undef, ''); $data .= chr(int rand 256) for 1..400; eval{ $dbh = DBI->connect('DBI:ODBC:testdb', '', '') or die $DBI::errstr; my $sth = $dbh->prepare('insert into btest(id, data) values (?,?);') +or die $dbh->errstr(); $sth->execute(1, $data) or die $dbh->errstr(); $dbh->disconnect(); }; print "Error : $@" if length $@;
When I run the above code I get the following error:testdb=# \d btest Table "btest" Attribute | Type | Modifier -----------+---------+---------- id | integer | not null data | text | Index: btest_id_key
I tried doing two thingsDBD::ODBC::st execute failed: Error while executing the query; ERROR: Unterminated quoted string (SQL-S1000) ERROR: Unterminated quoted string (SQL-S1000)(DBD: st_execute/SQLExec +ute err=-1 ) at C:\Perl\dev\rdm\btest.pl line 12.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PostgreSQL and binary data
by grep (Monsignor) on Dec 25, 2001 at 00:44 UTC | |
by rob_au (Abbot) on Dec 25, 2001 at 13:40 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |