Results 1 to 13 of 13
  1. #1
    Join Date
    Nov 2007
    Posts
    13

    Unanswered: How do i deal with 42907: The string is too long?????

    I get an error message
    IMPROPER USE OF LONG STRING COLUMN OR AN EXPRESSION THAT RESOLVES TO A LONG STRING KIT_STR. SQLCODE=-134, SQLSTATE=42907

    when i try to the following query:

    SELECT * FROM Some_table WHERE value_str = v_temp_str;

    Here:
    value_str is VARCHAR(1500)

    Any suggestions or ideas, corrections are welcome

  2. #2
    Join Date
    Jun 2007
    Posts
    66
    http://www-1.ibm.com/support/docview...id=swg1IY11811


    This link describes your problem..

  3. #3
    Join Date
    Jun 2007
    Posts
    66
    He basically says its a program error and such a long varchar cannot be used in joins..Any ideas from other forum members??

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by fatalerror
    I get an error message
    IMPROPER USE OF LONG STRING COLUMN OR AN EXPRESSION THAT RESOLVES TO A LONG STRING KIT_STR. SQLCODE=-134, SQLSTATE=42907

    when i try to the following query:

    SELECT * FROM Some_table WHERE value_str = v_temp_str;

    Here:
    value_str is VARCHAR(1500)

    Any suggestions or ideas, corrections are welcome
    What DB2 version and OS are you using?

    Andy

  5. #5
    Join Date
    Nov 2007
    Posts
    13
    db2 os/390 7.1.2

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by fatalerror
    db2 os/390 7.1.2
    That is what I thought. You need to post this the first time. I cannot help you as I only know DB2 for LUW.

    Andy

  7. #7
    Join Date
    Dec 2005
    Posts
    273
    Quote Originally Posted by fatalerror
    SELECT * FROM Some_table WHERE value_str = v_temp_str;
    v_temp_str ? Is this a column of the table ?

  8. #8
    Join Date
    Nov 2007
    Posts
    13
    it is a string variable. Or you can assume 'abc'

  9. #9
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Could you post us the complete scenario?
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  10. #10
    Join Date
    Nov 2007
    Posts
    13
    i have a table called say courselist
    eachtime i assign a courseid i query my courselist table to get the courselist column information and assign the id to it which is done as follows:

    SELECT count(*) into V_TEMP FROM COURSELIST WHERE COURSELIST_STR = V_COURSELIST;
    Last edited by fatalerror; 12-14-07 at 11:03.

  11. #11
    Join Date
    Nov 2007
    Posts
    13
    using 'like' will help fix this problem

  12. #12
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Can't you just provide us with some more information that we can actually understand what you try to do? Apparently, you have a sequence of SQL statements. Those may be inside a stored procedure or not - we don't know.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  13. #13
    Join Date
    May 2003
    Posts
    113
    I think for DB2/zOS v7, the string comparison can only handle 255 bytes or shorter.

Posting Permissions

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