Re: [GENERAL] How do you live without OUTER joins?

From: "Clark C(dot) Evans" <clark(dot)evans(at)manhattanproject(dot)com>
To: Bruce Bantos <anon(at)mgfairfax(dot)rr(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] How do you live without OUTER joins?
Date: 2000-01-13 06:02:23
Message-ID: Pine.LNX.4.10.10001130056520.8597-100000@cauchy.clarkevans.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 11 Jan 2000, Bruce Bantos wrote:
> In my current Oracle DB, I have a number of "lookup" tables
> that contain something like this:

You make a "lookup" function, and you call the
function in your select list.

It's been a few months since I've played with
PostgreSQL, so I don't remember the syntax.

An Oraclish example:

CREATE FUNCTION LOOKUP_CATEGORY_LONG_(VARCHAR2 ABBREV)
AS
myVar COMPANY_CATEGORY.COM_CAT_LONG%TYPE;
BEGIN
SELECT COM_CAT_LONG
INTO myVar
FROM COMPANY_CATEGORY
WHERE COM_CAT_ABBR = ABBREV;
RETURN myVar;
END;

SELECT COMPANY_NAME, LOOKUP_CATEGORY_LONG(COM_CAT_ABBR) CATEGORY
FROM COMPANY;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erdei Csaba 2000-01-13 07:38:43 Erdei Csaba : Help me
Previous Message Ed Loehr 2000-01-13 01:02:13 Re: [GENERAL] triggers & functions