If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Sql0102n error While inserting a large text into a clob column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-17-11, 07:54
edwin_fredrick edwin_fredrick is offline
Registered User
 
Join Date: Oct 2004
Posts: 44
Sql0102n error While inserting a large text into a clob column

Hi

When I am trying to insert a huge Text String in to the Clob Column. I am getting the following

SQL0102N The string constant beginning with "'SELECT... " is too long.

Since the String i am trying to insert is too large, I broke them into two separate strings and try to insert it, but still i am getting the same error.

Following is the code we try to concat two large string and stored it in CLOB column.

BEGIN ATOMIC
declare txt1 varchar(30000);
declare txt2 varchar(30000);

set txt1 = 'Large Text 1......';
set txt2 = 'Large Text 2...... ';
insert into test1 values (concat(txt1,txt2));
END
Reply With Quote
  #2 (permalink)  
Old 09-19-11, 02:50
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
maybe this
The string constant beginning with string has a length greater than 32672 bytes. Character strings with lengths greater than 32672 bytes or graphic strings with lengths greater than 16336 characters can be specified only through assignment from host variables. Note that other servers in the DB2 family of products may specify a different size limit for character strings. Consult the documentation for the appropriate DB2 product for details.
SQL0102N
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 09-19-11, 04:37
edwin_fredrick edwin_fredrick is offline
Registered User
 
Join Date: Oct 2004
Posts: 44
Quote:
Originally Posted by przytula_guy View Post
maybe this
The string constant beginning with string has a length greater than 32672 bytes. Character strings with lengths greater than 32672 bytes or graphic strings with lengths greater than 16336 characters can be specified only through assignment from host variables. Note that other servers in the DB2 family of products may specify a different size limit for character strings. Consult the documentation for the appropriate DB2 product for details.
SQL0102N
Thanks for you reply. Can you give me an example of using host variables?
I am from Oracle background.
Reply With Quote
  #4 (permalink)  
Old 09-19-11, 05:33
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
yes I could - but .. this is a justification to try to understand db2
have a look at the doc and try to understand
https://www-304.ibm.com/support/docv...id=swg27015148
or check the sample directory in db2 installation where you will find many samples..
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On