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 > Column Size Confusion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-27-07, 08:53
Illu Illu is offline
Registered User
 
Join Date: Sep 2007
Location: Dublin, Ireland
Posts: 2
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 09:04.
Reply With Quote
  #2 (permalink)  
Old 09-27-07, 10:21
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
SQL strings are quoted with single quotation marks, not double.
Reply With Quote
  #3 (permalink)  
Old 09-27-07, 10:23
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
Try single quote ' instad of double quote "
__________________
mota
Reply With Quote
  #4 (permalink)  
Old 09-27-07, 11:32
Illu Illu is offline
Registered User
 
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
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