pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Doug Thistlethwaite <doug.t@deltanet.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] combining columns in select
Date: Sun, 10 Oct 1999 17:04:16 +0200
Message-ID: <l03130302b4265990a282@[147.233.159.109]> (raw)
In-Reply-To: <38001E65.8155F291@deltanet.com>
References: <Pine.LNX.4.05.9910012118510.217-100000@helena.jens.de>
	<l03130301b41d34c87613@[147.233.159.109]>

At 07:04 +0200 on 10/10/1999, Doug Thistlethwaite wrote:


> What I was trying to do is develop a java application using the ODBC and then
> move it to postgres & a linux database when I had everything working.
> Unfortunately, I have discovered that there are many differences in the
> "standard SQL" that each driver uses.
>
> I could not find any ODBC drivers that us local data that allow the "||"
> concatenation symbol.  Most of them use the "+" symbol.  I have found the
>same
> problem with "Memo" vs "text" fields as well.  The ODBC driver for dbase (the
> one which seems to work best in my case) also uses the # symbol for dates
> while postgres likes the ' symbol.
>
> I guess I have to live with this and write separate query statements for each
> implementation.

If you want to write a  cross-platform JDBC application, you must avoid
non-standard SQL. The SQL92 standard operator for string concatenation is
just a single pipe char |. So neither "+" nor "||" are standard. In this
case, I don't think either of the databases supports the actual standard.
You can probably overcome this difficulty by setting a variable to either
"||" or "+", according to the type of driver you get, and build the SQL
queries using this variable.

As for the other things, you really have to conform to the standard.
Neither Memo nor Text are standard types. If you want standard, stick to
CHARACTER VARYING. As for dates, there are escape sequences in JDBC which
are supposed to convert dates from a common format to the format acceptable
to your particular database. Use these, and you are "standard".

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





view thread (6+ messages)

Message-ID: <l03130302b4265990a282@[147.233.159.109]>
Permalink:  ../l03130302b4265990a282@%5B147.233.159.109%5D/
Also on:    postgresql.org/message-id/l03130302b4265990a282@[147.233.159.109]

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: herouth@oumail.openu.ac.il, doug.t@deltanet.com
  Subject: Re: [SQL] combining columns in select
  In-Reply-To: <l03130302b4265990a282@[147.233.159.109]>
  References: <Pine.LNX.4.05.9910012118510.217-100000@helena.jens.de> <l03130301b41d34c87613@[147.233.159.109]> <l03130302b4265990a282@[147.233.159.109]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox