Home » SQL & PL/SQL » SQL & PL/SQL » Is it possible to.....
Is it possible to..... [message #252] Fri, 01 February 2002 01:49 Go to next message
Regan
Messages: 2
Registered: February 2002
Junior Member
....Declare a PL/SQL table with more than one data type?...Sorry but I really AM new to this!

Thanks (in anticipation)

Regan

ps...does anyone know what "POSITIONAL REFERENCING" means at all?
Re: Is it possible to..... [message #265 is a reply to message #252] Fri, 01 February 2002 17:42 Go to previous messageGo to next message
sokeh
Messages: 77
Registered: August 2000
Member
Declare a PL/SQL table with more than one data type?...

I say yes, take a look below
DECLARE
TYPE EnameTabTyp IS TABLE OF emp.ename%TYPE
INDEX BY BINARY_INTEGER;
TYPE SalTabTyp IS TABLE OF emp.sal%TYPE
INDEX BY BINARY_INTEGER;
sal_tab SalTabTyp; -- declare PL/SQL table
emp_tab EnameTabTyp; -- declare another PL/SQL table

ps...does anyone know what "POSITIONAL REFERENCING" means at all?

I say:
There are two types of references:
Positional and Named References also called Notations.
A positional reference means that the actual argument is associated with the formal argument
by position.
Example:
create or replace proc ref(
paramA varchar2,
paramB number,
paramC date)
as
begin
null;
end;
--call the store proc
declare
var1 varchar2(25);
var2 number;
var3 date;
begin
ref(var1 >= paramA,
var2 >= paramB,
var3 >= paramC);
As you can see, var1 points to paramA, var2 to paramB and var3 to paramC simply because the arguments are defined in order of 1, 2, 3.
So positional referencing is more sequential.
Named notation is more arbitrary.
Hope this helps.
Re: Is it possible to..... [message #276 is a reply to message #252] Sat, 02 February 2002 12:26 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
sokeh's answer is correct, but i believe you are looking for syntax of pl/sql table with more than one field for each element.

declare
type rec1 is record (empno number,ename varchar2(10));
type tab1 is table of rec1 index by binary_integer;

mytable tab1;

begin

mytable(1).empno:=123;
mytable(1).ename:='XYZ';
..

end;

HTH
Suresh
Re: Is it possible to..... [message #292 is a reply to message #276] Mon, 04 February 2002 02:54 Go to previous message
Regan
Messages: 2
Registered: February 2002
Junior Member
...it cetainly does help, Suresh!

Thanks for your time :)
Previous Topic: Creating Views with parameters..
Next Topic: Run two procedures one after the other
Goto Forum:
  


Current Time: Thu Apr 25 18:09:39 CDT 2024