suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IT25478 Status: Closed

CLP MIGHT NOT REMOVE 0x0A BYTE FROM THE STATEMENTS IF THY ARE EXECUTED
FROM SHELL SCRIPT.

product:
DB2 FOR LUW / DB2FORLUW / A50 - DB2
Problem description:
Example export command does not work as expected when 'modified
by implicitlyhiddeninclude' clause is being used
and there are 0x0A bytes in the statement.

Issue can be easily reproduced.

Normally one can create and populate table with sample data.

db2 "create table test (col1 int not null primary key, col2
char(10), col3 int IMPLICITLY HIDDEN)"
db2 "insert into test (col1, col2, col3) values (1,'L',1000)"
db2 "insert into test (col1, col2, col3) values (2,'L',1000)"
db2 "insert into test (col1, col2, col3) values (3,'K',4000)"
db2 "insert into test (col1, col2, col3) values (4,'N',6000)"
db2 "insert into test (col1, col2, col3) values (5,'C',1000)"
db2 "insert into test (col1, col2, col3) values (6,'X',7000)"
db2 "insert into test (col1, col2, col3) values (7,'W',8000)"

If the export command will be executed it works as expected:

db2 -v "export to new.exp of del modified by
implicitlyhiddeninclude
  select * from test order by col1,col2,col3 "

cat new.exp
1,"L         ",1000
2,"L         ",1000
3,"K         ",4000
4,"N         ",6000
5,"C         ",1000
6,"X         ",7000
7,"W         ",8000



Now one can prepare simple shell script like the one below:

$ cat script.sh
#!/bin/ksh
db2 connect to test33
db2 -v "export to new1.exp of del modified by
implicitlyhiddeninclude
select * from test
order by col1,col2,col3"

where statement is divided by the new line characters (byte
0x0A)

xxd script.sh
0000000: 2321 2f62 696e 2f6b 7368 0a64 6232 2063  #!/bin/ksh.db2
c
0000010: 6f6e 6e65 6374 2074 6f20 7465 7374 3333  onnect to
test33
0000020: 0a64 6232 202d 7620 2265 7870 6f72 7420  .db2 -v
"export
0000030: 746f 206e 6577 312e 6578 7020 6f66 2064  to new1.exp of
d
0000040: 656c 206d 6f64 6966 6965 6420 6279 2069  el modified by
i
0000050: 6d70 6c69 6369 746c 7968 6964 6465 6e69
mplicitlyhiddeni
0000060: 6e63 6c75 6465 0a20 7365 6c65 6374 202a  nclude. select
*
0000070: 2066 726f 6d20 7465 7374 0a20 6f72 6465   from test.
orde
0000080: 7220 6279 2063 6f6c 312c 636f 6c32 2c63  r by
col1,col2,c
0000090: 6f6c 3322 0a                             ol3".


If this script with export command will be executed it won't
work as expected.

chmod +x script.sh
./script.sh

export to new1.exp of del modified by implicitlyhiddeninclude
select * from test
order by col1,col2,col3
SQL3104N  The Export utility is beginning to export data to file
"new1.exp".
SQL3105N  The Export utility has finished exporting "7" rows.
Number of rows exported: 7

cat new1.exp
1,"L         "
2,"L         "
3,"K         "
4,"N         "
5,"C         "
6,"X         "
7,"W         "

The third column was not exported at all even though the export
itself works fine.
Problem Summary:
****************************************************************
* USERS AFFECTED:                                              *
* All users                                                    *
****************************************************************
* PROBLEM DESCRIPTION:                                         *
* See Error Description                                        *
****************************************************************
* RECOMMENDATION:                                              *
* Upgrade to Db2 10.5fp10                                      *
****************************************************************
Local Fix:
Solution
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
25.06.2018
28.06.2020
28.06.2020
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)