473,414 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 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 10248
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: A.V.C. | last post by:
Hello, I found members of this group very helpful for my last queries. Have one problem with CASE. I can use the column name alias in Order By Clause but unable to use it in WHERE CLAUSE. PLS...
1
by: noor | last post by:
Hi I have been working since 2 days to device a method to export sql table into csv format. I have tried using bcp with format option to keep the column names but I'm unable to transfer the file...
46
by: James Harris | last post by:
Before I embark on a new long-term project I'd appreciate your advice on how to split up long names. I would like to keep the standards for command names the same as that for variable names....
4
by: Scot L. Harris | last post by:
Currently using Postgresql 7.2.4-5.80 with php 4.2.2.-8.0.8 on a redhat 8.0 system. I am writing some php scripts where I want to generate a list of the column names in a particular table that...
14
by: Christian Sell | last post by:
Hello, I am running into a problem with PGs case sensitivity with regard to column and table names. I am using program components that require the object names returned from database metadata...
8
by: sara | last post by:
I have a table where a few of the users entered vendor names ALL IN UPPER CASE. I have created forms to edit the data, but I can't seem to allow changing JOE SMITH to Joe Smith. What to I have...
3
by: Anita Potekkat | last post by:
Hello, I had a question regarding Case Sensitivity in 10g & 9i. (1) Does Case Sensitivity in Oracle have to do with data only? Or does it also effect table & column names? For e.g. in a table...
6
by: Kc-Mass | last post by:
In a standard Ascii table a dash or hyphen is decimal 45. A period or dot is decimal 46. If I sort a table or recordset of mixed character string ascending in Access, those strings beginning with...
4
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.