Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    2

    Unanswered: Column Size Confusion

    Hi all,

    I'm trying to load a DB2 table from a CSV file but I am hitting a problem which seems to be related to the max column size.

    The column in question is char(30) size but when I try to put in the value "TABLE HEADER RECORD", which is 19 characters, it gives me an error (see the error below) with the number 18, implying that this is the max width which can be entered.

    DB2 SQL error: SQLCODE: -107, SQLSTATE: 42622, SQLERRMC: "TABLE HEADER RECORD";18

    The error for SQLSTATE 42622 is: "A name or label is too long."
    If anyone has any advice on how to get around this, or can tell me what I am doing wrong I would be very grateful.

    EDIT: Sorry, forgot to add the SQL which generated the error. Here it is
    INSERT INTO EOI.CCM_COST_CODE VALUES (1,"0","TABLE HEADER RECORD",0,"",0,0,0,0,"","","0001-01-01 00:00:00.0")

    Cheers,
    Illu
    Last edited by Illu; 09-27-07 at 10:04.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    SQL strings are quoted with single quotation marks, not double.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Sep 2003
    Posts
    237
    Try single quote ' instad of double quote "
    mota

  4. #4
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    2
    Thanks very much guys! Can't believe I missed that, all the Java Strings and concatenation must have confused me.

    Cheers again,
    Illu

Posting Permissions

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