473,217 Members | 2,102 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,217 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 10226
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.