pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brian Jarrett <digimotif@gmail.com>
To: pgsql-sql@postgresql.org
Subject: using sql on v7.4 server to feed stored procedure
Date: Fri, 30 Mar 2007 13:19:34 -0600
Message-ID: <68b897d90703301219p5a891976wf3f0baefc5f85551@mail.gmail.com> (raw)

I just found out that I posted this to the wrong list before, so if
this ends up as a cross-post, I'm sorry.

I've created some sql scripts to update a database in version 8.x and
now I'm trying to get them to run on servers using v7.4

The following statement works on 8.x servers, but not on 7.4 and I
can't figure out how to get it to operate in the earlier version:

select calc_cum_gpa_mp(marking_period_id::TEXT)
from (select distinct marking_period_id from student_mp_stats) as
sms1;

I get the error:

ERROR: syntax error at or near "("
SQL state: 42601
Context: compile of PL/pgSQL function "calc_cum_gpa_mp" near line 8

Can anyone point me in the right direction?  I've searched everywhere
for how to use stored procedures in sql queries, and haven't found how
to use the subquery to feed values to the stored procedure.  It almost
looks like I'd need to create another plpgsql function with a loop to
do the same thing.

Brian



view thread (2+ messages)  latest in thread

Message-ID: <68b897d90703301219p5a891976wf3f0baefc5f85551@mail.gmail.com>
Permalink:  ../68b897d90703301219p5a891976wf3f0baefc5f85551@mail.gmail.com/
Also on:    postgresql.org/message-id/68b897d90703301219p5a891976wf3f0baefc5f85551@mail.gmail.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: digimotif@gmail.com
  Subject: Re: using sql on v7.4 server to feed stored procedure
  In-Reply-To: <68b897d90703301219p5a891976wf3f0baefc5f85551@mail.gmail.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