![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Om, I'm bleeping upset as I've been at this for 3 days and been all over the net with nothing. *Maybe a genius from here can help. *We are on 10g. Task: *Update a CLOB column. *Actually replace the value, not appending. Code is this: PROCEDURE update_message_by_message_id ( * p_message_id * * * NUMBER, * p_sec_id * * * * * NUMBER, * p_variables * * * *VARCHAR2, * p_name * * * * * * VARCHAR2, * p_body * * * * * * CLOB, * p_changed_by * * * VARCHAR2, * p_status * * * * * VARCHAR2) IS . v_lob_locator * * * *CLOB := *EMPTY_CLOB(); . . * DBMS_LOB.OPEN (v_lob_locator,DBMS_LOB.LOB_READWRITE); * DBMS_LOB.WRITE(v_lob_locator, LENGTH(p_body),1,p_body); * DBMS_LOB.CLOSE(v_lob_locator); Tried EVERYTHING. *From a traditional UPDATE statement to this. Everything I try gives this error, EVERYTHING: ORA-22275: invalid LOB locator specified Even tried: *UPDATE messages SET body = p_body WHERE message_id = p_message_id; ORA-22275: invalid LOB locator specified Any help? *Please....... |
|
create table test_clob (a clob); Table created. insert into test_clob values ('clob_data'); 1 row created. select * from test_clob; A |
|
update test_clob set a = 'updated clob'; 1 row updated. update test_clob set a = to_clob('updated_clob'); 1 row updated. |
#3
| |||
| |||
|
|
Om, I'm bleeping upset as I've been at this for 3 days and been all over the net with nothing. *Maybe a genius from here can help. *We are on 10g. Task: *Update a CLOB column. *Actually replace the value, not appending. Code is this: PROCEDURE update_message_by_message_id ( * p_message_id * * * NUMBER, * p_sec_id * * * * * NUMBER, * p_variables * * * *VARCHAR2, * p_name * * * * * * VARCHAR2, * p_body * * * * * * CLOB, * p_changed_by * * * VARCHAR2, * p_status * * * * * VARCHAR2) IS . v_lob_locator * * * *CLOB := *EMPTY_CLOB(); . . * DBMS_LOB.OPEN (v_lob_locator,DBMS_LOB.LOB_READWRITE); * DBMS_LOB.WRITE(v_lob_locator, LENGTH(p_body),1,p_body); * DBMS_LOB.CLOSE(v_lob_locator); Tried EVERYTHING. *From a traditional UPDATE statement to this. Everything I try gives this error, EVERYTHING: ORA-22275: invalid LOB locator specified Even tried: *UPDATE messages SET body = p_body WHERE message_id = p_message_id; ORA-22275: invalid LOB locator specified Any help? *Please....... |
#4
| |||
| |||
|
|
On Aug 26, 11:23*pm, The Magnet <a... (AT) unsu (DOT) com> wrote: Om, I'm bleeping upset as I've been at this for 3 days and been all over the net with nothing. *Maybe a genius from here can help. *We are on 10g. Task: *Update a CLOB column. *Actually replace the value, not appending. Code is this: PROCEDURE update_message_by_message_id ( * p_message_id * * * NUMBER, * p_sec_id * * * * * NUMBER, * p_variables * * * *VARCHAR2, * p_name * * * * * * VARCHAR2, * p_body * * * * * * CLOB, * p_changed_by * * * VARCHAR2, * p_status * * * * * VARCHAR2) IS . v_lob_locator * * * *CLOB := *EMPTY_CLOB(); . . * DBMS_LOB.OPEN (v_lob_locator,DBMS_LOB.LOB_READWRITE); * DBMS_LOB.WRITE(v_lob_locator, LENGTH(p_body),1,p_body); * DBMS_LOB.CLOSE(v_lob_locator); Tried EVERYTHING. *From a traditional UPDATE statement to this. Everything I try gives this error, EVERYTHING: ORA-22275: invalid LOB locator specified Even tried: *UPDATE messages SET body = p_body WHERE message_id = p_message_id; ORA-22275: invalid LOB locator specified Any help? *Please....... Strange... does this code work for you? CREATE TABLE clobs(cid int, clob_data clob) INSERT INTO clobs(cid,clob_data) VALUES(1,'test') COMMIT; CREATE OR REPLACE PROCEDURE update_message_by_message_id ( * p_message_id * * * NUMBER, * p_body * * * * * * CLOB ) IS BEGIN UPDATE clobs SET clob_data = p_body WHERE cid = p_message_id; END; BEGIN update_message_by_message_id(1,'updated'); COMMIT; END; SELECT * FROM clobs; Matthias |
#5
| |||
| |||
|
|
On Aug 26, 11:23*pm, The Magnet <a... (AT) unsu (DOT) com> wrote: Om, I'm bleeping upset as I've been at this for 3 days and been all over the net with nothing. *Maybe a genius from here can help. *We are on 10g. Task: *Update a CLOB column. *Actually replace the value, not appending. Code is this: PROCEDURE update_message_by_message_id ( * p_message_id * * * NUMBER, * p_sec_id * * * * * NUMBER, * p_variables * * * *VARCHAR2, * p_name * * * * * * VARCHAR2, * p_body * * * * * * CLOB, * p_changed_by * * * VARCHAR2, * p_status * * * * * VARCHAR2) IS . v_lob_locator * * * *CLOB := *EMPTY_CLOB(); . . * DBMS_LOB.OPEN (v_lob_locator,DBMS_LOB.LOB_READWRITE); * DBMS_LOB.WRITE(v_lob_locator, LENGTH(p_body),1,p_body); * DBMS_LOB.CLOSE(v_lob_locator); Tried EVERYTHING. *From a traditional UPDATE statement to this. Everything I try gives this error, EVERYTHING: ORA-22275: invalid LOB locator specified Even tried: *UPDATE messages SET body = p_body WHERE message_id = p_message_id; ORA-22275: invalid LOB locator specified Any help? *Please....... Strange... does this code work for you? CREATE TABLE clobs(cid int, clob_data clob) INSERT INTO clobs(cid,clob_data) VALUES(1,'test') COMMIT; CREATE OR REPLACE PROCEDURE update_message_by_message_id ( * p_message_id * * * NUMBER, * p_body * * * * * * CLOB ) IS BEGIN UPDATE clobs SET clob_data = p_body WHERE cid = p_message_id; END; BEGIN update_message_by_message_id(1,'updated'); COMMIT; END; SELECT * FROM clobs; Matthias |
#6
| |||
| |||
|
|
On Aug 27, 6:41 am, mhoys<matthias.h... (AT) gmail (DOT) com> wrote: On Aug 26, 11:23 pm, The Magnet<a... (AT) unsu (DOT) com> wrote: Om, I'm bleeping upset as I've been at this for 3 days and been all over the net with nothing. Maybe a genius from here can help. We are on 10g. Task: Update a CLOB column. Actually replace the value, not appending. Code is this: PROCEDURE update_message_by_message_id ( p_message_id NUMBER, p_sec_id NUMBER, p_variables VARCHAR2, p_name VARCHAR2, p_body CLOB, p_changed_by VARCHAR2, p_status VARCHAR2) IS . v_lob_locator CLOB := EMPTY_CLOB(); . . DBMS_LOB.OPEN (v_lob_locator,DBMS_LOB.LOB_READWRITE); DBMS_LOB.WRITE(v_lob_locator, LENGTH(p_body),1,p_body); DBMS_LOB.CLOSE(v_lob_locator); Tried EVERYTHING. From a traditional UPDATE statement to this. Everything I try gives this error, EVERYTHING: ORA-22275: invalid LOB locator specified Even tried: UPDATE messages SET body = p_body WHERE message_id = p_message_id; ORA-22275: invalid LOB locator specified Any help? Please....... Strange... does this code work for you? CREATE TABLE clobs(cid int, clob_data clob) INSERT INTO clobs(cid,clob_data) VALUES(1,'test') COMMIT; CREATE OR REPLACE PROCEDURE update_message_by_message_id ( p_message_id NUMBER, p_body CLOB ) IS BEGIN UPDATE clobs SET clob_data = p_body WHERE cid = p_message_id; END; BEGIN update_message_by_message_id(1,'updated'); COMMIT; END; SELECT * FROM clobs; Matthias Ok, may have forgotten to mention this: This updated works fine when I call it directly from SQLPLUS, but, when the application is run using the website, no update takes place. Does that help at all? |
#7
| |||
| |||
|
|
On Aug 27, 6:41*am, mhoys <matthias.h... (AT) gmail (DOT) com> wrote: On Aug 26, 11:23*pm, The Magnet <a... (AT) unsu (DOT) com> wrote: Om, I'm bleeping upset as I've been at this for 3 days and been all over the net with nothing. *Maybe a genius from here can help. *We are on 10g. Task: *Update a CLOB column. *Actually replace the value, not appending. Code is this: PROCEDURE update_message_by_message_id ( * p_message_id * * * NUMBER, * p_sec_id * * * * * NUMBER, * p_variables * * * *VARCHAR2, * p_name * * * * * * VARCHAR2, * p_body * * * * * * CLOB, * p_changed_by * * * VARCHAR2, * p_status * * * * * VARCHAR2) IS . v_lob_locator * * * *CLOB := *EMPTY_CLOB(); . . * DBMS_LOB.OPEN (v_lob_locator,DBMS_LOB.LOB_READWRITE); * DBMS_LOB.WRITE(v_lob_locator, LENGTH(p_body),1,p_body); * DBMS_LOB.CLOSE(v_lob_locator); Tried EVERYTHING. *From a traditional UPDATE statement to this. Everything I try gives this error, EVERYTHING: ORA-22275: invalid LOB locator specified Even tried: *UPDATE messages SET body = p_body WHERE message_id = p_message_id; ORA-22275: invalid LOB locator specified Any help? *Please....... Strange... does this code work for you? CREATE TABLE clobs(cid int, clob_data clob) INSERT INTO clobs(cid,clob_data) VALUES(1,'test') COMMIT; CREATE OR REPLACE PROCEDURE update_message_by_message_id ( * p_message_id * * * NUMBER, * p_body * * * * * * CLOB ) IS BEGIN UPDATE clobs SET clob_data = p_body WHERE cid = p_message_id; END; BEGIN update_message_by_message_id(1,'updated'); COMMIT; END; SELECT * FROM clobs; Matthias Ok, may have forgotten to mention this: * This updated works fine when I call it directly from SQLPLUS, but, when the application is run using the website, no update takes place. Does that help at all? |
#8
| |||
| |||
|
|
Ok, may have forgotten to mention this: * This updated works fine when I call it directly from SQLPLUS, but, when the application is run using the website, no update takes place. Does that help at all? |
#9
| |||
| |||
|
|
Funny how you worked on this so hard for 3 days but forgot to include some basic things in a simple post to a newsgroup. Like for example some environments it works and others it does not. Why don't you produce a reproducible test case in sqlplus where it works and the same thing in the web environment where it fails. Then trace both of those test cases ... |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |