If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > ODBC parameters DB2 driver

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-18-08, 05:12
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
ODBC parameters DB2 driver

Hi, a couple of days ago I posted this question in the app.language forum but without result until now. Maybe this forum is better visited with the knowledge sought for.

Quote:
I'm using Delphi (6) for building a database application on an Informix database. Tables in there are all created with lowercase table and column names. Next to that I use a locally installed IBM UDB 8.2 database for development purposes. In that the table and column namens are uppercase by default. Both are connected through ODBC.
When using a TQuery component everything's fine, I write the query in Informix style and DB2 has no problems with it. But when using a TTable DB2 requires explicitly defined uppercase names in the component. That's no real problem because Informix accepts these components regardless of the case. But since Informix is the production system and my DB2 merely a test one I prefer defining all components in the application in Informix style.
So I'm searching for a way in which DB2 can also accept lowercase table and column names defined in a TTable component. And I'm thinking of a driverparameter or something or a TTable (or TDatabase) property but haven't found one yet. Maybe someone here had the same experience (e.g. with migration from Informix to DB2) and found an answer...
Regards, Hans
Reply With Quote
  #2 (permalink)  
Old 03-18-08, 05:16
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Just use the standardized way for this: use delimited identifiers. A delimited identifier is one with double-quotes around it, and everything between the double quotes are treated as-is (special characters and case-sensitive):

Code:
CREATE TABLE "mySchema"."myTable" (
   cOlUmN1 INT
)
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 03-18-08, 09:38
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
Hi, thanks.

I saw that possibility earlier but didn't know how it would react. I'll try that for new tables I'll create.

Regards
Reply With Quote
  #4 (permalink)  
Old 03-21-08, 05:52
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
Hi, what I was afraid for with the "delimited identifiers" solution comes true; now the query components aren't interchangeable for Informix and DB2 when building queries dynamicly. The DB2 queries need quoted names for the table and columns while Informix can't parse those.
Now I'm still looking for a parameter with which DB2 can resolve the table and column names to the default (uppercase) names regardless of the case of the names in the presented commands.

Regards,
Hans
Reply With Quote
  #5 (permalink)  
Old 03-21-08, 13:36
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
I guess you are out of luck. DB2 implements the SQL standard in this respect, and I know of no flag to change that.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #6 (permalink)  
Old 03-22-08, 07:13
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
OK thanks. I'll have to work around it in the application then.

Regards,
Hans
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On