Skip site navigation (1) Skip section navigation (2)

Passing and reading composite values to/in a function

From: Greg <grigorey(at)yahoo(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Passing and reading composite values to/in a function
Date: 2010-10-07 11:27:22
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hi all, 

Does anyone knows how to pass composite value to a function and read passed values in the function without declaring custom type. The passed composite value correspond to row structure defined in a View.
    create function Foo ( data View%ViewRowType??? ) returns void as $$
          insert into tableName values (data.FieldName);
    end; $$ language plpgsql;

Call toa function will then would look like this: 
   Foo( ROW('value') );

Or is there a way to define an array that can accept combination of any data types?


pgsql-novice by date

Next:From: Wolfgang KellerDate: 2010-10-07 11:51:38
Subject: Internationalisation of database content (text columns)
Previous:From: Jean-Yves F. BarbierDate: 2010-10-07 08:52:45
Subject: log into a table

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group