Есть таблица
ID Number
ClobValue CLOB
Нужно загнать в таблицу strings длиной больше 4К.
Oracle выдает еrror:
ORA-01704: string literal too long.
пробовал:
INSERT INTO MY_TABLE VALUES
(10,
to_clob('bol'shoj string > 4K'));
тот же резултат.
слышал нужно как то то emty_clob() function использовать.
не подскажете?
Спасибо
Вопрос по Oracle
-
- Уже с Приветом
- Posts: 176
- Joined: 05 Sep 2000 09:01
- Location: Seattle,WA,USA
-
- Уже с Приветом
- Posts: 664
- Joined: 05 Jun 2002 01:11
Re: Вопрос по Oracle
BoTa wrote:Есть таблица
ID Number
ClobValue CLOB
Нужно загнать в таблицу strings длиной больше 4К.
Oracle выдает еrror:
ORA-01704: string literal too long.
пробовал:
INSERT INTO MY_TABLE VALUES
(10,
to_clob('bol'shoj string > 4K'));
тот же резултат.
слышал нужно как то то emty_clob() function использовать.
не подскажете?
Спасибо
http://download-west.oracle.com/docs/cd ... .htm#93879
"Data stored in a LOB is termed the LOB's value. The value of an internal LOB may or may not be stored inline with the other row data. If you do not set DISABLE STORAGE IN ROW and the internal LOB value is less than approximately 4,000 bytes, then the value is stored inline; otherwise it is stored outside the row.
.........
The maximum amount of LOB data stored in the row is the maximum VARCHAR2 size (4000). This includes the control information as well as the LOB value. If you indicate that the LOB should be stored in the row, once the LOB value and control information is larger than 4000, the LOB value is automatically moved out of the row.
"
... and..
Code: Select all
"CREATE or REPLACE PROCEDURE writeDataToLOB_proc IS
Lob_loc CLOB;
Buffer VARCHAR2(32767);
Amount BINARY_INTEGER := 32767;
Position INTEGER := 1;
i INTEGER;
BEGIN
/* Select a LOB: */
SELECT ad_sourcetext INTO Lob_loc
FROM Print_media
WHERE product_id = 2056 AND ad_id = 12001 FOR UPDATE;
/* Opening the LOB is optional: */
DBMS_LOB.OPEN (Lob_loc, DBMS_LOB.LOB_READWRITE);
/* Fill the buffer with data to write to the LOB: */
FOR i IN 1..3 LOOP
DBMS_LOB.WRITE (Lob_loc, Amount, Position, Buffer);
/* Fill the buffer with more data to write to the LOB: */
Position := Position + Amount;
END LOOP;
/* Closing the LOB is mandatory if you have opened it: */
DBMS_LOB.CLOSE (Lob_loc);
END;
"
Rgds,
-
- Уже с Приветом
- Posts: 176
- Joined: 05 Sep 2000 09:01
- Location: Seattle,WA,USA