Re: [GENERAL] How do you live without OUTER joins? - Mailing list pgsql-general

From Clark C. Evans
Subject Re: [GENERAL] How do you live without OUTER joins?
Date
Msg-id Pine.LNX.4.10.10001130056520.8597-100000@cauchy.clarkevans.com
Whole thread Raw
In response to How do you live without OUTER joins?  ("Bruce Bantos" <anon@mgfairfax.rr.com>)
List 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;



pgsql-general by date:

Previous
From: Ed Loehr
Date:
Subject: Re: [GENERAL] triggers & functions
Next
From: Julian Scarfe
Date:
Subject: Re: [GENERAL] Simulating an outer join