From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: SQL operator '*='
Date: Mon, 23 Dec 2019 15:49:03 +0100
Message-ID: <509a447f-8304-c2c2-f3c8-fb46d07e6239@gmx.net> (raw)
In-Reply-To: <20191223143348.GA2874@c720-r342378>
References: <20191223143348.GA2874@c720-r342378>
Matthias Apitz schrieb am 23.12.2019 um 15:33:
> I've here a smaller problem of our porting from Sybase/Oracle/Informix
> code to PostgreSQL; the code reads for the mentioned DBS:
>
>
> #ifdef DBSORA
> EXEC SQL DECLARE land_cursor CURSOR FOR
> SELECT stammprio, lkz, landbez, plkz, postbez, karenz1, karenz2,
> karenz3, land.wkz, webez, we, kurs, land.del
> FROM land, devisen
> WHERE land.wkz = devisen.wkz (+) AND land.brgroup = devisen.brgroup (+) AND land.brgroup = :brgroupHost_for_helpland_cursor
> ORDER BY stammprio, landbez;
> #endif
>
> #ifdef DBSSYB
> EXEC SQL DECLARE land_cursor CURSOR FOR
> SELECT stammprio, lkz, landbez, plkz, postbez, karenz1, karenz2,
> karenz3, land.wkz, webez, we, kurs, land.del
> FROM land, devisen
> WHERE land.wkz *= devisen.wkz AND land.brgroup *= devisen.brgroup AND land.brgroup = :brgroupHost_for_helpland_cursor
> ORDER BY stammprio, landbez;
> #endif
>
> (the code for DBSPOS was just copied from Sybase). It compiles fine but
> raises on execution en error about operator '*=' is not supported...
T-SQL (Sybase and SQL Server) uses *= for outer joins, just as Oracle uses (+)
Haven't used either of those outdated operators in decades, but I think the equivalent would be:
FROM land
LEFT JOINdevisen
on land.wkz = devisen.wkz
AND land.brgroup = devisen.brgroup
AND land.brgroup = :brgroupHost_for_helpland_cursor
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-general@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: SQL operator '*='
In-Reply-To: <509a447f-8304-c2c2-f3c8-fb46d07e6239@gmx.net>
References: <20191223143348.GA2874@c720-r342378> <509a447f-8304-c2c2-f3c8-fb46d07e6239@gmx.net>
* 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