Home » Developer & Programmer » JDeveloper, Java & XML » ORA-22275: invalid LOB locator specified
icon4.gif  ORA-22275: invalid LOB locator specified [message #168918] Mon, 24 April 2006 03:33 Go to next message
RohitArora
Messages: 1
Registered: April 2006
Junior Member
Hi All,

I am a newbie to the PL/SQL area. I am trying to generate the XML for a record to insert the data into an audit trail for the table. To do so, I declared a string for VARCHAR2(4000) and it was working fine until the data increased the limit due to a field comments (which itself is VARCHAR2(4000)).

To increase the limit, I changed the type to CLOB and ever since my code has stopped working,

The following is a section of the code that I am using to get the data:

GET_CHANGE_LOG_USERS := '<Transaction type="insert">' || CHR(10) ||
'<Field value="LOGON_ID">' || CHR(10) ||
'<OldValue/>' || CHR(10) ||
'<NewValue>' ||
GET_Record.LOGONID ||
'</NewValue>' || CHR(10) ||
'</Field>' || CHR(10) ||
'<Field value="ROLE">' || CHR(10) ||
'<OldValue/>' || CHR(10) ||
'<NewValue>' || GET_ROLE_CD ||
'</NewValue>' || CHR(10) ||
'</Field>' || CHR(10) ||

................
There are a copule of more fields..
................
................
................
................
'<Field value="COMMENTS">' || CHR(10) ||
'<OldValue/>' || CHR(10) ||
'<NewValue>' ||
GET_Record.COMMENTS||
'</NewValue>' || CHR(10) ||
'</Field>'
'</Transaction>';

INSERT INTO AUDIT
(
DATE_CHANGED,
DOC_GUID,
ADMIN_GUID,
CHANGE
)

VALUES
(
SYSDATE,
GET_DOC_GUID,
GET_ADMIN_GUID,
GET_CHANGE_LOG_USERS
);

Your help will be very much appricaited...
Rgds
Rohit Arora
Re: ORA-22275: invalid LOB locator specified [message #196283 is a reply to message #168918] Wed, 04 October 2006 14:52 Go to previous message
inapal
Messages: 14
Registered: September 2006
Junior Member
Check using CLOB datatype, and "to_clob" function.

To do this, you must declare GET_CHANGE_LOG_USERS as CLOB datatype (instead of VARCHAR2).

Then, you must fill it using "to_clob" function. Something like this:

GET_CHANGE_LOG_USERS := to_clob(
'<Transaction type="insert">' ||
'<Field value="LOGON_ID">' ||
'<OldValue/>' ||
...
...
...
'</Field>' ||
'</Transaction>'
);

Previous Topic: Struggling with XML
Next Topic: Using 9.2.0.4 jdbc driver with 9.2.0.8 db
Goto Forum:
  


Current Time: Thu Nov 28 16:55:51 CST 2024