CREATE TYPE and %ROWTYPE

From: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
To: PostGreSQL <pgsql-novice(at)postgresql(dot)org>
Subject: CREATE TYPE and %ROWTYPE
Date: 2005-04-03 13:18:46
Message-ID: 1112534326.1235.55.camel@retsol1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

(Sorry if this appears twice - I sent the previous mail as the wrong
mail ID)

PostgreSQL 7.4.5

Is there a way of using %ROWTYPE in custom types?
I want to return two/three complete record areas to a calling 4gl
program.
I can define a custom type, ie:
CREATE TYPE myTest AS (
fld1 INTEGER,
fld2 VARCHAR,
fld3 .......etc
);
This works fine. But if I define:
CREATE TYPE myTest AS (
area1 tableName1%ROWTYPE,
area2 tableName2%ROWTYPE
);
I get an error. This then means that I have to define myTest with the
individual fields (which I can do) - but which in turn means that if the
tables change, I have to remember to change the procs.

Regards,

Steve Tucknott

ReTSol Ltd

DDI: 01903 828769

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ennio-Sr 2005-04-03 16:22:54 Re: how to ignore accents?
Previous Message Sean Davis 2005-04-03 12:45:27 Re: :(( VEEERRRRYYYY SLLLOOOWWWWWW!