Quote:
|
The sql is stored in a varchar(32000) on the source table. When I put the double quotes on the echo, I now get a record echo'd out that is 32000 bytes long.
|
If the column is defined as varchar(32000), I don't understand why you are retrieving what appears to be full width columns. I'm using Oracle instead of DB2, but the principle should be the same.
Code:
create table my_table
(sql_statement varchar(1000));
insert into my_table values ('select * from table2');
select sql_statement || '#' from my_table;
Here is my output:
Code:
SQL_STATEMENT||'#'
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
select * from table2#
1 row selected.
Have you tried trimming the output as you select it from the DB2 database?
Code:
select trim(sql_statement) || '#' from my_table;
The output is the same (i.e., no trailing spaces for the data), unless the long line of dashes is giving you a problem:
Code:
TRIM(SQL_STATEMENT)||'#'
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
select * from table2#
1 row selected.