Dear List,

I run into problems while trying to insert values into a blob column via the php module. As far as I understand the documentation I would do that with a command sequence like this(assuming that $connection holds a valid connection):

$insert_query = "insert into blobtable (nr, value) values(1,?)";
$insert_stmt = maxdb_prepare($connection, $insert_query);

$null = NULL;
$value ="VALUE";
maxdb_stmt_bind_param($insert_stmt, 'b', $null);
maxdb_stmt_execute($insert_stmt);

maxdb_stmt_send_long_data ($insert_stmt, 0, $value);
maxdb_stmt_close_long_data($insert_stmt, 0);

echo "Row inserted.";

The Table blobtable is created with this statement:

CREATE TABLE "MT"."BLOBTABLE"
(
    "NR" Fixed (6,0) NOT NULL,
    "VALUE"  LONG BYTE  NOT NULL,
    PRIMARY KEY ("NR")
)

When calling the above php-script I get this waring:
maxdb_stmt_execute(): -10414 Conversion from binary value to string is not enabled for parameter/column (1)

Which in a way makes sense, because $value is of type string. Apart from the fact, that this is not what I want to do(storing really large strings and binary data), changing the binding of the parameter to this:
maxdb_stmt_bind_param($insert_stmt, 's', $null);

ends up in this warning:
maxdb_stmt_send_long_data(): Initialization failed [Parameter -1073756220 is not a lob]

Has anyone a hint or an example on how to insert large binary/string values into a blob column via the php module correctly?

Any help is appreciated!

Best regards,
Mario

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to