#3314 Cannot insert CLOB/BLOB using prepared statements

open
nobody
None
5
2013-06-04
2013-06-04
Jira Trac
No

{code}
CREATE TABLE php_cubrid_lob_test(
doc_content clob,
image blob
) COLLATE iso88591_bin ;
{code}

I created this table in demodb database and ran the following script through php:
{code}
$con = cubrid_connect(localhost, 33000, demodb, dba, );
if ($con) {
$sql = INSERT INTO php_cubrid_lob_test(doc_content) VALUES(?);
$req = cubrid_prepare($con, $sql);

$fp = fopen(book.txt, rb);

cubrid_bind($req, 1, $fp, clob);
cubrid_execute($req);
}
{code}

I created a book.txt file with some sample text.

The records insert were correctly found in the databases/lob folder. However, if I run a:
{code}
SELECT * from php_cubrid_lob_test
{code}

It gives only NULL values. Same goes for BLOB.

Secondly, I tried to insert the data using Insert by input value and placed a string in the CLOB field and it gave out the error in the attached screenshot.

Thirdly, there is no option to select a file to be imported (ascii file for CLOB for example and any binary file for BLOB).

Discussion