[lug] OT: CPP question

Tkil tkil at scrye.com
Sat Mar 30 19:32:00 MST 2002


>>>>> "George" == George Sexton <Sexton> writes:
George> Actually I am pre-processing a SQL Script into multiple
George> variants. I.E. SQL Server, Postgresql, Oracle, etc. 

a few other thoughts on trying to make programs (and, eventually,
schemas [1] and queries) database independent.  when i worked at hp,
we had a lot of fun transitioning a system from informix to oracle.

1. quoting.  as George has already discovered, the rules of quoting
   are lots of fun.

2. outer join syntax & capabilities.  oracle is the only db i've
   worked with that allows you to an outer join on selected columns
   out of a given table; all the others, you have to outer join the
   whole table.  (but you could join it twice, i suppose, once as a
   normal join, and again as an outer join?)

3. NULL vs empty string.  informix distinguished the two, oracle
   doesn't.  zany hilarity ensues.  (this is the origin of "VARCHAR2",
   since the SQL standard specifies that VARCHAR must distinguish
   them...)

4. BLOBs, CLOBs, NOTE fields, MEMO fields, etc, etc.

5. case sensitivity of tablespace/table/column names.  i seem to
   remember that oracle actually was case-sensitive here, but that its
   SQL parser would uppercase everything as it went.  you could use
   double quotes to use table names with mixed case.

some of these changes (number 3 in particular) lead to pretty
extensive reworking of programs.  others were just inconveniences.

in one project i worked on, i used objects to represent all the
application-level queries, then subclassed them for each personality
of database.

good luck.  i'd be interested in hearing what you ended up using as a
solution for this.

t.

[1] how does one pluralize "schema"?  schemata?  my tome-o-knowledge
    (webster's new universal unabridged dictionary, 1996) says that
    both "schemata" and "schemas" are ok...



More information about the LUG mailing list