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: 953248.10668.qm@web29705.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.
 
Example:
    create function Foo ( data View%ViewRowType??? ) returns void as $$
    begin
          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?

Thanks.

Browse pgsql-novice by date

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