Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01704: string literal too long

534103Mar 16 2010 — edited Mar 17 2010
Hi Experts,

I have installed STR2TBL to my database as follows,
-- DROP FUNCTION STR2TBL;
-- DROP TYPE VCARRAY;

CREATE OR REPLACE TYPE VCARRAY AS TABLE OF CLOB;
/
CREATE OR REPLACE FUNCTION STR2TBL(pmString IN CLOB,pmDelimiter IN VARCHAR2:= ',') RETURN VCARRAY PIPELINED
AS
    vintLength  NUMBER := LENGTH(pmString);
    vintStart   NUMBER := 1;
    vintIndex   NUMBER;
BEGIN
        
    --Starting While Loop
    WHILE (vintStart <= vintLength)
    LOOP
        vintIndex := INSTR(pmString, pmDelimiter, vintStart);
        IF vintIndex = 0 THEN
            PIPE ROW (SUBSTR(pmString, vintStart));
            vintStart := vintLength + LENGTH(pmDelimiter);
        ELSE
            PIPE ROW (SUBSTR(pmString, vintStart, vintIndex - vintStart));
            vintStart := vintIndex + LENGTH(pmDelimiter);
        END IF;
    END LOOP;
    --End Loop
        
    -- Returning Record Set
    RETURN;
END STR2TBL;
Even the Input Parameter Datatype is CLOB, I can able to just pass 4000 characters to my functions.
When i send more than 4000 characters, it throw error as

ORA-01704: string literal too long

As my input may be more than 4000 character string, i just thought a second to go with XML but i have some more additional work to define the XML for the front end as per ORACLE feasible XML Parsing.

I haven't worked with XML so fa, it takes some time.

First Option:
Is that any way i work around with character string input more than 4000 characters in my SP.

Second Option:
Go with XML input and parse XML to store values in Database.

My Process:
Sample Input Will look like this for storing my rendering in Database
cropX=0[XXXXXXXXX]cropY=26[XXXXXXXXX]cropWidth=250[XXXXXXXXX]cropHeight=142[XXXXXXXXX]rotation=0[XXXXXXXXX]vFlip=[XXXXXXXXX]hFlip=[XXXXXXXXX]reSizeWidth=625[XXXXXXXXX]reSizeHeight=357[XXXXXXXXX]slotRotate=0[XXX#XXX]textColor=#000000[XXXXXXXXX]textX=14[XXXXXXXXX]....
[YYYYYYYYYY]
cropX=0[XXXXXXXXX]cropY=26[XXXXXXXXX]cropWidth=250[XXXXXXXXX]cropHeight=142[XXXXXXXXX]rotation=0[XXXXXXXXX]vFlip=[XXXXXXXXX]hFlip=[XXXXXXXXX]reSizeWidth=625[XXXXXXXXX]reSizeHeight=357[XXXXXXXXX]slotRotate=0[XXX#XXX]textColor=#000000[XXXXXXXXX]textX=14[XXXXXXXXX]....
Each Slot Values will come with Separator [XXXXXXXXX] and for each slot the rendering values such as CropX,CropY,Rotation will come with Separator [YYYYYYYYYY]. There Can be multiple Slots with multiple Values for each slots.


Please Suggest me how to proceed this.

Thanks,
Dharan V
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2010
Added on Mar 16 2010
13 comments
4,671 views