Complex column ref.

From: Arve Fahlvik <afa(at)vivatech(dot)no>
To: pgsql-sql(at)postgresql(dot)org
Subject: Complex column ref.
Date: 2002-01-25 16:29:53
Message-ID: 3C518801.208@vivatech.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello

I wonder if it is possible to refer to different columns in a query
without usin 'execute'.

If I have the following table:
create table test(
a int,
b int,
c int);

declare
r record;
i numeric;
begin
.
select ref into i from reftable where ...;
select * into r from test where oid=...;
if r[i] = 2002 then
do something;
end if;
.
end;

In other words: I'm looking for a dynamic way of refer to columns
without using 'execute'.

I hope the explanation of what I want to do is understandable.

Thanks

afa

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2002-01-25 17:32:53 Re: LIMIT Optimization
Previous Message Josh Berkus 2002-01-25 16:16:34 Re: linking from SQL Server