Re: SQL-Programmer tool and field%type support - Mailing list pgsql-sql

From Josh Berkus
Subject Re: SQL-Programmer tool and field%type support
Date
Msg-id web-144013@davinci.ethosmedia.com
Whole thread Raw
In response to Re: SQL-Programmer tool and field%type support  (Roberto Mello <rmello@cc.usu.edu>)
Responses Re: SQL-Programmer tool and field%type support  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Mourad,

> > I have an other question about the use of %type and alias in
> PL/SQL.  So the
> > excution of functions containing varibales of type
> maytable.field1%type
> > prompts parser errors.
> > error on the creation of the function :
> > create function test (int) returns maytable.field1%type as' ...

What Roberto is saying is that the declaration:

DECLARE
v_field1 mytable.field1%type

is supported internal to a PL/pgSQL function, but

CREATE FUNCTION test1(int) RETURNS mytable.filed1%type 

is not.  This is because the %type declaration is supported in PL/pgSQL,
but not in Postgres SQL.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: Roberto Mello
Date:
Subject: Re: SQL-Programmer tool and field%type support
Next
From: "Saurabh Mittal"
Date:
Subject: ROUND function ??