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 > 80 character limitation on VARCHAR variable

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-04-05, 13:32
bfmaclean bfmaclean is offline
Registered User
 
Join Date: Mar 2005
Posts: 8
80 character limitation on VARCHAR variable

I have this code:

DECLARE v_insert VARCHAR(255);

SET v_insert = 'INSERT INTO mytable (field1, field2, field3, field4, field5, field6, field7, field8 field9)';
SET v_insert = v_insert || ' Select * from sometable';

EXECUTE IMMEDIATE v_insert;

Problem is the v_insert variable only holds 80 characters. The first assignment statement has more than 80 so it cuts it off. I tried 1000 in the varchar declaration.

Is there another variable to use or is there a reason I'm limited to 80 characters?

Blaise
Reply With Quote
  #2 (permalink)  
Old 03-04-05, 14:12
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
How do you determine that "the v_insert variable only holds 80 characters"?
Reply With Quote
  #3 (permalink)  
Old 03-04-05, 14:21
bfmaclean bfmaclean is offline
Registered User
 
Join Date: Mar 2005
Posts: 8
80 char limit

In the Development Center debug window. I was wondering if it's a problem with the debug window so I am trying to put the string out to a table right now.
Reply With Quote
  #4 (permalink)  
Old 03-04-05, 14:30
bfmaclean bfmaclean is offline
Registered User
 
Join Date: Mar 2005
Posts: 8
80 character limit

Thanks for the lead n_i, when I inserted the data into a table I could see the full string. I just assumed the debugger was showing me the correct value.

regards,
Blaise
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