pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antonis Antoniou <a.antoniou@albourne.com>
To: Patrice OLIVER <oliverp21@free.fr>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problem with stored procedure
Date: Thu, 26 Aug 2004 17:59:10 +0300
Message-ID: <412DFABE.3090008@albourne.com> (raw)
In-Reply-To: <412DE07D.1060800@free.fr>
References: <412DE07D.1060800@free.fr>

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'';



view thread (3+ messages)

Message-ID: <412DFABE.3090008@albourne.com>
Permalink:  ../412DFABE.3090008@albourne.com/
Also on:    postgresql.org/message-id/412DFABE.3090008@albourne.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: a.antoniou@albourne.com, oliverp21@free.fr
  Subject: Re: Problem with stored procedure
  In-Reply-To: <412DFABE.3090008@albourne.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox