pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Witney <awitney@sghms.ac.uk>
To: jclaudio@capitol.fr, pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: how to create a multi columns return function ?
Date: Tue, 21 Oct 2003 19:42:36 +0100
Message-ID: <BBBB3CAC.26B9E%awitney@sghms.ac.uk> (raw)
In-Reply-To: <OFC6DC4FE3.EDDE1832-ONC1256DC6.004816D3-C1256DC6.00482FCD@capitol.fr>


Take a look at the section on 'SQL Functions Returning Sets'


http://www.postgresql.org/docs/7.3/static/xfunc-sql.html#AEN31304



> Hi 
> 
> I'm moving databases from sybase to postgres.
> But I have difficulties in creating a postgres equivalent to the sybase stored
> procedures... 
> 
> Apparently, Postgres functions should work, but the syb stored procedures get
> only one parameter and return several colums
> 
> Here's the code I wrote in postgresql :
> 
> create function function_name( int ) returns text
> AS ' SELECT column1, column2, column3,...,column15
> FROM table_name 
> WHERE colum1 = $1 AND column5 = \'specific value\' AND column8 =
> \'specific_value2 \' '
> LANGUAGE 'SQL'; 
> 
> and I get the message error : returns multi columns
> 
> I'm wondering too if It's possible to create a view with a parameter if
> functions don't work.
> 
> Has anybody faced the same problem ?
> 
> I need help 
> 
> thanks



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




view thread (3+ messages)  latest in thread

Message-ID: <BBBB3CAC.26B9E%awitney@sghms.ac.uk>
Permalink:  ../BBBB3CAC.26B9E%25awitney@sghms.ac.uk/
Also on:    postgresql.org/message-id/BBBB3CAC.26B9E%awitney@sghms.ac.uk

 · 

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: awitney@sghms.ac.uk
  Subject: Re: how to create a multi columns return function ?
  In-Reply-To: <BBBB3CAC.26B9E%awitney@sghms.ac.uk>

* 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