Hi,
it seems that you are trying to insert binary values into a character
long column (long [ascii|unicode]). For binary values you should define
your table column as long byte. The following code snippet gives an
example on how to insert Blob/Clob values into the database using
DBD::MaxDB.
my $rc;
my $dbh = DBI->connect() or die "Can't connect $DBI::err
$DBI::errstr\n";
print " Test 2: create table\n";
$dbh->{PrintError} = 0;
$dbh->do ("DROP TABLE BLOBTEST");
$dbh->{PrintError} = 1;
$rc = $dbh->do ("CREATE TABLE BLOBTEST (I INTEGER, L LONG ASCII)");
my $long_gen = "abcdefghijklmnopqrstuvwxyz";
my $long_description = $long_gen x 2000;
print " Test 3: insert into table\n";
my $sth1 = $dbh->prepare ("INSERT INTO BLOBTEST (I, L) VALUES (?, ?)");
$rc |= $sth1->bind_param (1, 1);
$rc |= $sth1->bind_param (2, $long_description);
$rc |= $sth1->execute ();
regards,
Marco
-----------------
Marco Paskamp
MaxDB, SAP Berlin
> -----Original Message-----
> From: Robert Sedlacek [mailto:[EMAIL PROTECTED]
> Sent: Dienstag, 19. Juli 2005 14:40
> To: [email protected]
> Subject: MaxDB BLOB values
>
> Hi there,
>
> I just have a quick question: What's the right way to write LONGs into
> the MaxDB database with DBD::MaxDB / DBI?
>
> I tried:
> - Just wildcards
> - using $dbh->quote
> - using bind_param without type
> - using bind_param with &DBI::SQL_BLOB() as type param
> - using bind_param with &DBI::SQL_LONGVARBINARY() as type param
>
> The Error Message i get is
> "DBD::MaxDB::st execute failed: Conversion from binary value to
> string is not enabled for parameter/column (1) at ..."
>
> LongReadLen is set high enough ..
>
> It would be great if someone could give me a hint on this one.
>
> Thanks for your time,
> Robert
>
>
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]