Home » SQL & PL/SQL » SQL & PL/SQL » Passing CLOB data as input paramter
Passing CLOB data as input paramter [message #457465] Mon, 24 May 2010 11:05 Go to next message
Hemanth123
Messages: 56
Registered: April 2009
Member
Dear All,

I have a requirement where in I have to store large data in one of the database columns using stored procedure.
So I have declared the column as CLOB as it can store upto 4GB and also the input parameter for the procedure as CLOB.
But when I am trying to pass large data it is not allowing to store as it is throwing literal string too large error.

Is there any restriction in the data size to be passed to the stored procedure?
If so how can I handle this situation?

Please advice how to solve this issue.

Thanks
Heamnth
Re: Passing CLOB data as input paramter [message #457467 is a reply to message #457465] Mon, 24 May 2010 11:10 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

>Is there any restriction in the data size to be passed to the stored procedure?

It depends upon the procedure & the datatype of the argument.
Re: Passing CLOB data as input paramter [message #457468 is a reply to message #457465] Mon, 24 May 2010 11:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68767
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
PL/SQL string max lentgh it 32K.
You have to pass the string by chunks.

Regards
Michel
Re: Passing CLOB data as input paramter [message #457471 is a reply to message #457467] Mon, 24 May 2010 11:16 Go to previous messageGo to next message
Hemanth123
Messages: 56
Registered: April 2009
Member
Ok here are the details..
I have a table as below
CREATE TABLE
USER_CONFIG(CFGID VARCHAR2(35),CFGDATA CLOB);

Procedure to insert records into the above table:

CREATE PROCEDURE UserConfig_Sp(In_CfgID USER_CONFIG%TYPE,In_CfgData USER_CONFIG%TYPE)
AS
BEGIN
INSERT INTO USER_CONFIG
(CFGID,CFGDAT)
VALUES
(In_CfgId,In_CfgData);
END;

But when trying to execute the same manually or from the application I am not able to insert the larger data more than some 4000 characters.
Could any one help in solving this issue as how to insert a large data?
Re: Passing CLOB data as input paramter [message #457473 is a reply to message #457471] Mon, 24 May 2010 11:19 Go to previous messageGo to next message
Hemanth123
Messages: 56
Registered: April 2009
Member
Hi Michel,

Yeah it is accepting upto 32k but beyond 32k it is throwing an error.
Couls you please elaborate on how to handle this?
Re: Passing CLOB data as input paramter [message #457475 is a reply to message #457473] Mon, 24 May 2010 11:21 Go to previous messageGo to next message
Michel Cadot
Messages: 68767
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Yes, I could, but could you tell me what is the client language and how you call your procedure?
Till now you SAY you have an error but you didn't SHOW it.

Regards
Michel
Re: Passing CLOB data as input paramter [message #457476 is a reply to message #457475] Mon, 24 May 2010 11:26 Go to previous messageGo to next message
Hemanth123
Messages: 56
Registered: April 2009
Member
We are trying to call/execute the stored procedure from Dot Net Application.
Whenever we try to pass more than 32k then we are getting the following error:

ORA-01704: String Literal Too Long

Advice on the issue.
Re: Passing CLOB data as input paramter [message #457477 is a reply to message #457476] Mon, 24 May 2010 11:37 Go to previous messageGo to next message
Michel Cadot
Messages: 68767
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
http://www.google.com/search?hl=en&source=hp&q=Oracle+.net+clob&aq=f&aqi=&aql=&oq=&gs_rfai=

First link:
Writing to Oracle CLOB fields using System.Data.OracleClient ... 6 Sep 2005 ... In one of our current projects we need to write large chunks of text to an Oracle CLOB field from an ASP.NET 1.1 application. ...

Second link:
Working with Oracle LOBs Working with Oracle LOBs. The .NET Framework Data Provider for Oracle includes the OracleLob class, which is used to work with Oracle LOB data types. ...

Third link:
How do i Read Write Oracle CLOB data in ASP.NET or VB.NET ... 24 Jul 2008 ... NET ? Ans: It took me 2 days to come up with the simpletes method to read/write ORACLE CLOB data. And I would like to share that with all ...
ripalsoni.wordpress.com/.../how-do-i-read-write-oracle-clob-data-in-aspnet-or-vbnet/

Fourth link:
Fun with Oracle CLOBs 13 Apr 2006 ... We are storing XML data in a CLOB field. In the beginning we used the Oracle ODP.NET provider. When we got into performance testing we found ...

And so on.


Regards
Michel

[Updated on: Mon, 24 May 2010 11:40]

Report message to a moderator

Re: Passing CLOB data as input paramter [message #457478 is a reply to message #457476] Mon, 24 May 2010 11:40 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Whenever we try to pass more than 32k then we are getting the following error:

a "string" is not a CLOB.
VARCHAR2 datatype is limited to 32767.
Do not rely on implicit datatype conversion.

Read The Fine Manual on DBMS_LOB

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#ARPLS020
Re: Passing CLOB data as input paramter [message #457480 is a reply to message #457478] Mon, 24 May 2010 12:50 Go to previous message
Hemanth123
Messages: 56
Registered: April 2009
Member
Thank you very much for your valuable suggestions!!!!
Previous Topic: plsql procedure and function
Next Topic: counting the rows of all the tables in database
Goto Forum:
  


Current Time: Thu Aug 21 15:57:33 CDT 2025