community.borland.com

Article #19504: Oracle 8 BLOB / CLOB ORA-22275 ORA-00932 ORA-01461

 Question and Answer Database

     FAQ: FAQ4504B - Oracle 8 BLOB /  CLOB ORA-22275 ORA-00932 ORA-01461
Category: Database (Oracle)
Platform: All-32Bit
 Product: All-CBuilder,   BC++5.x,   C++Builder1.0,   C++Builder3.x,   C++Builder4.x,   Delphi2.x,   Delphi3.x,   Delphi4.x,   VdBase7.x,   

Question:

BDE 5.0x, Oracle 8 SQL Links driver, TQuery/SQL

Why am I having trouble inserting/updating Oracle 8 BLOB and/or CLOB 
datatypes where the data >=4k?




Answer:

Oracle 8 driver inserting/updating to BLOB or CLOB datatypes 
where the data >=4k:

INSERT INTO TESTBLOB (ICOMPONENTID, GIMAGE)
VALUES (:CID, :GIMAGE)

will raise the error:
	EDBEngineError with message 'General SQL error.
	ORA-22275: invalid LOB locator specified'


This statement with a CLOB type (should use "empty_clob()"):
	insert into TESTBLOB (ICOMPONENTID, GIMAGE) 
	values(:CID, empty_blob() ) returning GIMAGE into :GIMAGE 

will raise the error:
	EDBEngineError with message 'General SQL error.
	ORA-00932: inconsistent datatypes'.


If "oracle8blobs := true" (Delphi 4.x) is not used with the Oracle 8 
SQL Links driver (and Oracle 8 srvr)
the error below will be raised with data >=4k :

	EDBEngineError with message 'General SQL error.
	ORA-01461: can bind a LONG value only for insert into a LONG column'.


Information on "oracle8blobs" from the Delphi 4 dbtables.pas:

Global variable for parameter binding to Oracle8 CLOB & BLOB field types.
Set this to True before executing a query on that uses these types.
Assign the data using TParam.AsMemo for CLOB and TParam.AsBlob for BLOB.
Note you cannot mix CLOB/BLOB and RAW/LONG RAW in the same query.

Please refer to your Oracle 8 documentation for information regarding the 
use of empty_blob() and empty_clob().

7/13/99 10:47:47 AM
 

Last Modified: 01-SEP-99