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

Re: Problem with stored procedure

From: "Antonis Antoniou" <a(dot)antoniou(at)albourne(dot)com>
To: "Patrice OLIVER" <oliverp21(at)free(dot)fr>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Problem with stored procedure
Date: 2004-08-26 14:59:10
Message-ID: 412DFABE.3090008@albourne.com (view raw or flat)
Thread:
Lists: 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'';

In response to

pgsql-sql by date

Next:From: Ian PercivalDate: 2004-08-26 15:58:10
Subject: expression_tree_walker: Unexpected node type 711
Previous:From: Richard HuxtonDate: 2004-08-26 13:31:36
Subject: Re: Problem with stored procedure

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