pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jie Liang <jliang@ipinc.com>
To: pgsql-sql@postgresql.org
Subject: PL/pgSQL
Date: Mon, 07 Aug 2000 13:00:04 -0700
Message-ID: <398F1543.39B7F6A8@ipinc.com> (raw)

Hi, there,
1.
Is anybody know how to declare a explicit cursor in PL/SQL in postgres?
1. I want create a function use PL/pgSQL:
create function foo() returns whatevertype as '
declare
  v_asda int2;
  cursor is select a,b,c from AAA;   -- what is the syntex?
begin
  statements
end;
' langauge 'plpgsql';
2. for the record type, can I explicitly define my own record like:
declare
   type blah is record(ename text,job text,id int 4);
   type blahblah is table of blah index by int4;            -- like in
Oracle
......

3. how to define an array in PL/pgSQL declare block and assign it in
execuable block?
like:
declare
    ary int[5];        --  in PL/pgSQL  maybe is _int;
began
    ary[1]:= 3;        -- give me error when I run it;
end;

Thanks.

--
Jie LIANG

Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang@ipinc.com
www.ipinc.com






view thread (13+ messages)  latest in thread

Message-ID: <398F1543.39B7F6A8@ipinc.com>
Permalink:  ../398F1543.39B7F6A8@ipinc.com/
Also on:    postgresql.org/message-id/398F1543.39B7F6A8@ipinc.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: jliang@ipinc.com
  Subject: Re: PL/pgSQL
  In-Reply-To: <398F1543.39B7F6A8@ipinc.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