Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248

    Unanswered: 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.

    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

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  3. #3
    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

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

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  6. #6
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248
    OK thanks. I'll have to work around it in the application then.

    Regards,
    Hans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •