Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL Help - PL/SQL tables

PL/SQL Help - PL/SQL tables

From: <Ed.Stevens_at_nmm.nissan-usa.com>
Date: Mon, 11 Jan 1999 18:28:56 GMT
Message-ID: <77dft4$tp$1@nnrp1.dejanews.com>


Subject: PL/SQL Help - PL/SQL tables

I have some requirements for a PL/SQL script that get beyond the basic stuff I’ve done up to now. I’ve figured enough out from the manual to know I need to use a PL/SQL table, which then involves some declarations, but can’t quite seem to get it all put together properly. I’m hopeing some here can block together a skeleton to show me how to get started. Using MOPC (My Own Pseudo Code), what I want to do looks something like this:

Define Internal_Table		; define a table or array
Internal_Table(1) = “aaaa”		; initialize an occurance
Internal_Table(2) = “bbbb”	; initialize an occurance
Internal_Table(3) = “cccc”		; initialize an occurance
Internal_Table(4) = “dddd”	; initialize an occurance

For x = 1 to 4 do
	Connect scott/tiger_at_internal_table(1)
	Do_some_work

End

What I’ve got so far in PL/SQL is this:

SET TERMOUT ON HEADING ON PAGES0 VERIFY ON ECHO ON FEEDBACK OFF --
DECLARE
  TYPE DBRecTyp IS RECORD
    ( DBName char(6) :='' );

  TYPE DBTabTyp IS TABLE OF DBRecTyp
    INDEX BY BINARY_INTEGER;   DBTab DBTabTyp;

  DB CHAR(6);   cursor c1 is
    select DBName from DBTab;

  BEGIN

    DBTab(1).DBName := 'LCOSDB';
    DBTab(2).DBName := 'NPSSDB';
    DBTab(3).DBName := 'NMMSDB';

    open c1;
----- see what we got so far ------

    fetch c1 into db;
    fetch c1 into db;
END;
/

Ed Stevens
Nissan Motor Mfg. Corp., USA

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Jan 11 1999 - 12:28:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US