RE: [odb-users] ODB compiler for oracle, double qoutes SQL?statements

Magnus Granqvist magnus.granqvist at tailormade.se
Tue Nov 20 08:30:46 EST 2012


Thanks, it works.

Br,
Magnus

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: den 20 november 2012 14:49
To: Magnus Granqvist
Cc: odb-users at codesynthesis.com
Subject: Re: [odb-users] ODB compiler for oracle, double qoutes SQL?statements

Hi Magnus,

Magnus Granqvist <magnus.granqvist at tailormade.se> writes:

> But I think I see why this is happening now, the table must be created 
> with quotes to support the SQL.

Yes, in other words, the tables were created without quoting and Oracle uppercased them.


> This could be a problem developing for existing production databases 
> that is not created with qoutes
> 
> CREATE TABLE "dagsmproduct" (
>   "oidval" RAW(16),
>   "msisdn" VARCHAR2(512) NOT NULL PRIMARY KEY);

In this case it is probably best to assign custom table/column names that correspond exactly to the existing names. This way, also, you can use more descriptive C++ names that follow your naming convention.
For example:

#pragma db object table("DAGSMPRODUCT")
class DagSmProduct
{
  ...

  #pragma db type("RAW(16)") column("OIDVAL")
  char oid_val[16];

  #pragma db id column("MSISDN")
  std::string ms_isdn;
};

Boris





More information about the odb-users mailing list