pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PL/pgsql questions..
2+ messages / 2 participants
[nested] [flat]

* PL/pgsql questions..
@ 1999-04-25 17:10 tveith@heaven.oeh.univie.ac.at
  1999-04-26 07:31 ` Re: [SQL] PL/pgsql questions.. Jan Wieck <jwieck@debis.com>
  0 siblings, 1 reply; 2+ messages in thread

From: tveith@heaven.oeh.univie.ac.at @ 1999-04-25 17:10 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I'm new on this list and i'm using postgreSQL 6.5. I think it has done a
great step towards usability since the days when i last took a look at it
(postgres 95).. congrats, you did a very good job.

One thing which I think is really important is PL/pgsql.. I carefully read
the bit of information which is available, but thats not very much..

I have 2 questions.. first, can you point me to some information about
this topic which i maybe have missed?

second, take this procedure from an informix database:

create procedure list_abteilung (p_mandnr smallint)
  returning smallint, char(30);

define v_abtnr smallint;
define v_abtbez char(30);

foreach
  select a.abtnr, a.abtbez
  into   v_abtnr, v_abtbez
  from   gm_abt a, gm_maabt m
  where  a.abtnr=m.abtnr
    and  m.gesperrt<>1
    and  a.gesperrt<>1
    and  m.mandant=p_mandnr
  return v_abtnr, v_abtbez with resume;
end foreach;

end procedure;

i will try to explain the two main features of this procedure: foreach is
a loop which iterates through the resultset of the query; return with
resume returns a row to the caller and then continues with the procedure.

of course i know that this particular procedure could be easily
substituted by a view; i just took it because it is short and
demonstrates this two important features.

so my question is, does PG/plsql support this, if so how, and if not, is
it planned to be supported in the near future?

best regards,
Thomas Veith 





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] PL/pgsql questions..
  1999-04-25 17:10 PL/pgsql questions.. tveith@heaven.oeh.univie.ac.at
@ 1999-04-26 07:31 ` Jan Wieck <jwieck@debis.com>
  0 siblings, 0 replies; 2+ messages in thread

From: jwieck@debis.com @ 1999-04-26 07:31 UTC (permalink / raw)
  To: tveith@heaven.oeh.univie.ac.at; +Cc: pgsql-sql

Thomas Veith wrote:
>
> One thing which I think is really important is PL/pgsql.. I carefully read
> the bit of information which is available, but thats not very much..

    Tnx

>
> I have 2 questions.. first, can you point me to some information about
> this topic which i maybe have missed?

    Maybe you missed the docs in the programmers manual?

>
> second, take this procedure from an informix database:
>
> [...]
>
> so my question is, does PG/plsql support this, if so how, and if not, is
> it planned to be supported in the near future?

    Functions  in procedural languages (PL/Tcl, PL/pgSQL) inherit
    the  same  restrictions  C   language   functions   have   in
    PostgreSQL.  One  of  them  I  hate  most is that they cannot
    return  set  results.   Thus  "RETURN  ...  AND  RESUME"   is
    currently  not  supported.  It  requires major changes to the
    function manager and executor.

    The time I expect it is not that near in future I would  like
    it.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-04-26 07:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-04-25 17:10 PL/pgsql questions.. tveith@heaven.oeh.univie.ac.at
1999-04-26 07:31 ` Jan Wieck <jwieck@debis.com>

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