Re: Problem with stored procedure - Mailing list pgsql-sql

From Antonis Antoniou
Subject Re: Problem with stored procedure
Date
Msg-id 412DFABE.3090008@albourne.com
Whole thread Raw
In response to Problem with stored procedure  (Patrice OLIVER <oliverp21@free.fr>)
List pgsql-sql
Patrice OLIVER wrote:

> Hello,
>
> In this example, I use 2 tables :
> create table types (
> typnum integer primary key,
> catcode varchar(2),
> typlib varchar(35));
>
> create table uv (
> uvnum varchar(5) primary key,
> typnum integer,
> uvlib varchar(50));
>
> alter table uv
>   add constraint fk_uv_type foreign key (typnum)
>      references types (typnum)
>      on delete restrict on update restrict;
>
> I also use stored procedures :
>
> create function numtype(varchar) returns integer as '
> declare
>   codetype alias for $1;
>   coderet integer;
> begin
>   select into coderet typnum from types
>       where typcode = codetype and catcode = ''UV'';

why not -> select *typenum* into coderet  from types     where typcode = codetype and catcode = ''UV'';


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Problem with stored procedure
Next
From: Greg Stark
Date:
Subject: Re: from PG_DUMP to CVS