Page 1 of 1

SQL INSERT with VARCHAR Column

PostPosted: Wed Apr 01, 2015 2:07 am
by vhindizon
I need to create a job using Easytrieve that reads a file and inserts the record in a DB2 table.
The file contains a description field with 400 chars and would be inserted in DESC VARCHAR (400) column in a DB2 table. The description has variable length. I was able to insert but it is filling out all 400 chars (trailing spaces). Is there a way i can code to insert to the table with variable length?
Thanks.

Re: SQL INSERT with VARCHAR Column

PostPosted: Wed Apr 01, 2015 3:31 am
by BillyBoyo
Is there nothing in your Easytrieve Plus documentation? If you wanted to do this is COBOL, what would you do? The same should work.

Re: SQL INSERT with VARCHAR Column

PostPosted: Wed Apr 01, 2015 4:46 am
by vhindizon
i know the steps for cobol where the dclgen has the length and text variables for the varchar column. I
can get the actual length of the field but i do not how to setup of declare the varchar variable in easytrieve and how the insert sql would look like. thanks.