472,141 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

Mixed Case in table and column names.

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
4 10075
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
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
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
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.

Similar topics

3 posts views Thread by A.V.C. | last post: by
4 posts views Thread by Scot L. Harris | last post: by
14 posts views Thread by Christian Sell | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.