Is it possible to..... [message #252] |
Fri, 01 February 2002 01:49  |
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   |
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   |
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
|
|
|
|