pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dongsoo Yoon <dsyoon@metasoftworks.com>
To: pgsql-sql@postgresql.org
Subject: Is there a type like a growable array, similar Vector at Java language in postgreSQL?
Date: Fri, 22 Jul 2005 15:30:22 +0900
Message-ID: <000a01c58e86$d63cae30$6a0aa8c0@notebook04> (raw)


In Oracle, there is a type like a growable array, similar Vector at Java language.

In postgreSQL, is there any type like bellow type?


---------------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PROCEDURE test(
   p_size       in  number
  ,p_proccode  out varchar2
  ,p_procmesg  out varchar2
)
IS

  v_count                 number default 0;
  v_dayIndex              number default 0;
  v_size                  number default 0;
  
  type tb_NumTable is table of number(2) index by binary_integer;------------>like a growable array
  t_modifiedTimes tb_NumTable;----------------------------------------------->declare a variable using above defined type.
 
  ....

BEGIN 

....

  v_size := nvl(p_size, 0);

  for v_count in 1..v_size loop

     v_dayIndex := v_dayIndex + 1;

     t_modifiedTimes[v_dayIndex ] := v_count;


   end loop; 

  ....
 
  p_proccode := 0;
  p_procmesg := 'OK';
      
EXCEPTION
 
  WHEN OTHERS THEN
    p_proccode := SQLCODE;
    p_procmesg := SUBSTR(SQLERRM, 1, 255);

end test;

view thread (2+ messages)  latest in thread

Message-ID: <000a01c58e86$d63cae30$6a0aa8c0@notebook04>
Permalink:  ../000a01c58e86$d63cae30$6a0aa8c0@notebook04/
Also on:    postgresql.org/message-id/000a01c58e86$d63cae30$6a0aa8c0@notebook04

 · 

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: dsyoon@metasoftworks.com
  Subject: Re: Is there a type like a growable array, similar Vector at Java language in postgreSQL?
  In-Reply-To: <000a01c58e86$d63cae30$6a0aa8c0@notebook04>

* 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