Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    60

    Unanswered: 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

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Oct 2004
    Posts
    60
    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.

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •