You have column names defined in the table - and in system catalogue - in MiXeD cAsE.
In my CLP (Command Line Processor) example I used escape quotes to pass to Db2 mixed case column name:
You may want to explain what driver and which version you are using in what application written in what language - you will need to provide some evidence (CLI trace, ODBC trace, JDBC trace) so culprit of folding statement into upper case can be found.
Original Message:
Sent: Mon May 22, 2023 11:23 AM
From: Yaseen Shaik
Subject: DB2 client is changing the correponding SQL Statements to upper case, which is causing the issue
Actual issue is more complex than the above solution and we don't want that statement to be changed to upper case.
Original Message:
Sent: 5/22/2023 10:08:00 AM
From: Jan Nelken
Subject: RE: DB2 client is changing the correponding SQL Statements to upper case, which is causing the issue
ALTER TABLE <tabname> RENAME COLUMN <column_name> TO <new_column_name>
A simple example:
db2 create table MyTable (\"BadName\" Char(1))
DB20000I The SQL command completed successfully.
db2 describe table mytable Data type Column
Column name schema Data type name Length Scale Nulls
------------------------------- --------- ------------------- ---------- ----- ------
BadName SYSIBM CHARACTER 1 0 Yes
1 record(s) selected.
db2 alter table MYTABLE rename column \"BadName\" to BADNAME
DB20000I The SQL command completed successfully.
db2 describe table mytable
Data type Column
Column name schema Data type name Length Scale Nulls
------------------------------- --------- ------------------- ---------- ----- ------
BADNAME SYSIBM CHARACTER 1 0 Yes
1 record(s) selected.
------------------------------
Jan Nelken
Original Message:
Sent: Mon May 22, 2023 07:49 AM
From: Yaseen Shaik
Subject: DB2 client is changing the correponding SQL Statements to upper case, which is causing the issue
We are fine with Table names, but the issue is with Mixed case columns of tables , so any suggestion for this?
Regards
Yaseen
Original Message:
Sent: 5/19/2023 4:26:00 AM
From: Damir Wilder
Subject: RE: DB2 client is changing the correponding SQL Statements to upper case, which is causing the issue
Hi Yaseen,
The quickest option to work around this issue (that I can think of right now) would be to create an upper-case alias for each mixed-case object name (tables/views) found in the system catalogue, for example:
CREATE ALIAS TABSCHEMA.TABLENAME FOR "TabSchema.TabName"
That way you won't have to alter any of your SQL statements as they will be able to reach the tables via their aliases.
Regards, Damir
------------------------------
Damir Wilder
Original Message:
Sent: Wed May 17, 2023 08:45 AM
From: Yaseen Shaik
Subject: DB2 client is changing the correponding SQL Statements to upper case, which is causing the issue
Hello Team,
We have migrated our Data Services from Oracle to DB2 environment. We have also exported source repositories to target system repositories. But in target environment, when we try to execute the jobs, they are failing. We found in the log that DB2 client is changing the correponding SQL Statements to upper case, which is causing the issue. For example, in a Template table there is a field "Global Account Number" in a Template table Customer_Master. During transformation while loading data through the job, DB is converting statement as INSERT INTO CUSTOMER_MASTER("GLOBAL ACCOUNT NUMBER") VALUES('ACCD') and throwing error as field "GLOBAL ACCOUNT NUMBER" not found. It is not treating column names as case in-sensitive. In Source environment, this works fine.
Could you please let us know how to resolve this issue
------------------------------
Yaseen Shaik
------------------------------