By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,473 Members | 3,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,473 IT Pros & Developers. It's quick & easy.

Mixed Case in table and column names.

P: n/a
Hi;
I am transferring data from MySql to db2 using my own java/jdbc program.
Working out ok, except for the fact that our apps use mixed-case names for
tables and columns. Although my CREATE TABLE commands issued via jdbc uses
mixed case for the names, db2 insists on using only upper case. (This also
happens from the CLP or DB2CC, but my concern is for it to [also]work via
jdbc.)

Is there a simple setting at the database level to allow mixed case?

How do I tell db2 NOT to uppercase my table and column names?

Thanks,
nat
Mar 28 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In article <pa***************************@oneeasysystemSNIP.c om>,
na******@oneeasysystemSNIP.com says...
Hi;
I am transferring data from MySql to db2 using my own java/jdbc program.
Working out ok, except for the fact that our apps use mixed-case names for
tables and columns. Although my CREATE TABLE commands issued via jdbc uses
mixed case for the names, db2 insists on using only upper case. (This also
happens from the CLP or DB2CC, but my concern is for it to [also]work via
jdbc.)

Is there a simple setting at the database level to allow mixed case?

How do I tell db2 NOT to uppercase my table and column names?

Thanks,
nat


It will automatically uppercase unless you surround them with double
quotes, something like 'select "tbColumn" from "tbSchema"."tbName"'
Mar 29 '06 #2

P: n/a
Ian
natG wrote:
Hi;
I am transferring data from MySql to db2 using my own java/jdbc program.
Working out ok, except for the fact that our apps use mixed-case names for
tables and columns. Although my CREATE TABLE commands issued via jdbc uses
mixed case for the names, db2 insists on using only upper case. (This also
happens from the CLP or DB2CC, but my concern is for it to [also]work via
jdbc.)

Is there a simple setting at the database level to allow mixed case?

How do I tell db2 NOT to uppercase my table and column names?


What difference does it make? By default, DB2 ignores case in SQL
statements (as you've found), so:

select column1 == select ColuMn1 == SELECT COLUMN1

As Gert suggested, you can force DB2 to use mixed case by enclosing
object names in quotes, but this will create a serious administrative
pain for you in the future.

Mar 29 '06 #3

P: n/a
On Tue, 28 Mar 2006 19:17:36 -0700, Ian wrote:
natG wrote:
Hi;
I am transferring data from MySql to db2 using my own java/jdbc program.
Working out ok, except for the fact that our apps use mixed-case names for
tables and columns. Although my CREATE TABLE commands issued via jdbc uses
mixed case for the names, db2 insists on using only upper case. (This also
happens from the CLP or DB2CC, but my concern is for it to [also]work via
jdbc.)

Is there a simple setting at the database level to allow mixed case?

How do I tell db2 NOT to uppercase my table and column names?


What difference does it make? By default, DB2 ignores case in SQL
statements (as you've found), so:

select column1 == select ColuMn1 == SELECT COLUMN1

Well, if you have a J2EE server, that automatically [internally] surrounds
your object names with quotes, there might be a problem.
Suppose db2 has a table, MYTABLE, with a column COLUMN1. Now, *via jdbc*,
SELECT "Column1" from "MyTable"
Since the quotes are telling it to be case sensitive, it will not match
with its upper-cased names. (At least that's how it is with MySql.)
nat

Mar 29 '06 #4

P: n/a
natG wrote:
On Tue, 28 Mar 2006 19:17:36 -0700, Ian wrote:
natG wrote:
Hi;
I am transferring data from MySql to db2 using my own java/jdbc program.
Working out ok, except for the fact that our apps use mixed-case names for
tables and columns. Although my CREATE TABLE commands issued via jdbc uses
mixed case for the names, db2 insists on using only upper case. (This also
happens from the CLP or DB2CC, but my concern is for it to [also]work via
jdbc.)

Is there a simple setting at the database level to allow mixed case?

How do I tell db2 NOT to uppercase my table and column names?

What difference does it make? By default, DB2 ignores case in SQL
statements (as you've found), so:

select column1 == select ColuMn1 == SELECT COLUMN1

Well, if you have a J2EE server, that automatically [internally] surrounds
your object names with quotes, there might be a problem.
Suppose db2 has a table, MYTABLE, with a column COLUMN1. Now, *via jdbc*,
SELECT "Column1" from "MyTable"
Since the quotes are telling it to be case sensitive, it will not match
with its upper-cased names. (At least that's how it is with MySql.)
nat

If your client uses quotes then so should you when you create the tables.

Cheers
Serge

PS: I hate it when clients do all this automatic stuff that is not
compatible with either performance or the SQL Standard *sigh*
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Mar 29 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.