LONG type - ORA-01704: string literal too long - Php [message #51246] |
Wed, 08 May 2002 19:09 |
VerĂ³nica
Messages: 3 Registered: November 2001
|
Junior Member |
|
|
Hello!
I'm working with an Oracle database from Php scripts.
I use Php OCI functions to work with the database (OCILogOn, OCILogOff, OCIParse, OCIExecute, etc.).
One of the tables has a LONG field, and I'm having trouble when trying to save long strings (longer than 4000 bytes) in that field.
I'm treating that field like a Varchar2 field in inserts and updates.
Could anyone tell me how to save those long strings in the LONG field? I'm new to Oracle, and I must solve this problem real fast.
Thanks!!!!!!!!!!
|
|
|
Re: LONG type - ORA-01704: string literal too long - Php [message #51256 is a reply to message #51246] |
Thu, 09 May 2002 22:59 |
Peter
Messages: 62 Registered: August 2000
|
Member |
|
|
try www.phpbuilder.com
I have not tried this with long columns as such,
Though I have done this with clobs not that this helps, but if you are still developing clobs may be a better option than longs
$conn=OCILogon("username","password");
$clob = OCINewDescriptor($conn, OCI_D_LOB);
//setup the query
$query = "update DB_NOTES set $updating_column = ".
"EMPTY_CLOB() where criteria = 'X' ".
"returning $updateing_columninto :THE_CLOB";
$stmt = OCIParse($conn, $query);
// then bind the :THE_CLOB to $clob
OCIBindByName($stmt, ":THE_CLOB", &$clob, -1, OCI_B_CLOB);
OCIExecute($stmt, OCI_DEFAULT);
// this saves the information to the database via the descriptor
$clob->save($the_data);
OCICommit($conn);
OCIFreeStatement($stmt);
OCILogoff($conn);
|
|
|
|