Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Changing long to clob results in ora 1461

Changing long to clob results in ora 1461

From: Anup <amullick_at_telcordia.com>
Date: 17 Nov 2005 06:24:51 -0800
Message-ID: <1132237491.003481.203830@o13g2000cwo.googlegroups.com>


We are using Pro C++ and embedded sql (not oci). When we used Oracle 9i, we had a table VYSR_RESPONSE defined as MSGID NOT NULL NUMBER,
MESSAGE LONG. The host variable was declared something like EXEC SQL BEGIN DECLARE SECTION;
static VARCHAR Message[5009];
static int Msgid;
EXEC SQL END DECLARE SECTION; The code snippet for the insert looks something like memcpy (Message.arr, char_string, 5009); Message.len = 5009;
Msgid = 0;
EXEC SQL INSERT INTO VYSR_RESPONSE (MSGID,MESSAGE) VALUES (:Msgid,:Message);

This coding used to work. When we went to oracle 10g, we altered the MESSAGE column from LONG to CLOB. The table rows are transient so there was no necessity to migrate any data - the table was empty when upgrading to oracle 10g. Theoretically, the coding for insert should work without change. In reality, it works most of the time, but every now and then we get ora 1461 on the insert, meaning, can bind a LONG value only for insert into a LONG column. For some reason oracle thinks the host variable Message is a long value. Changing the values clause to VALUES (:Msgid,to_lob(:Message)) or VALUES (:Msgid,to_clob(:Message)) did not help. Any suggestions? Received on Thu Nov 17 2005 - 08:24:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US