pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Witham <davidw@unidial.com.au>
To: pgsql-sql@postgresql.org
Subject: parse error when calling function in plpgsql
Date: Fri, 14 Mar 2003 20:18:42 +1100
Message-ID: <CFA248776934FD43847E740E43C346D1379668@ozimelb03.ozicom.com> (raw)

I have a function that returns a record that works fine when I call it from psql:

mydb=# select * from myfunc(...params...) as (col1 real,col2 integer);
    col1 | col2 
---------+----------
0.806667 | 17000104
(1 row)

I have tried to call it from within another function like this:

...
declare
	myrec record;
...
select * into myrec from myfunc(...params...) as (col1 real,col2 integer);
...

but I keep getting a parse error:

WARNING:  Error occurred while executing PL/pgSQL function myparentfunc
WARNING:  line 27 at select into variables
ERROR:  parser: parse error at or near "$1" at character 72

How do I get the record returned from myfunc to be assigned to myrec?

Thanks,
David Witham



view thread (2+ messages)  latest in thread

Message-ID: <CFA248776934FD43847E740E43C346D1379668@ozimelb03.ozicom.com>
Permalink:  ../CFA248776934FD43847E740E43C346D1379668@ozimelb03.ozicom.com/
Also on:    postgresql.org/message-id/CFA248776934FD43847E740E43C346D1379668@ozimelb03.ozicom.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: davidw@unidial.com.au
  Subject: Re: parse error when calling function in plpgsql
  In-Reply-To: <CFA248776934FD43847E740E43C346D1379668@ozimelb03.ozicom.com>
  References: <CFA248776934FD43847E740E43C346D1379668@ozimelb03.ozicom.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