Home » SQL & PL/SQL » SQL & PL/SQL » problem on associative array
problem on associative array [message #250950] Thu, 12 July 2007 00:04 Go to next message
subhadip.chanda
Messages: 64
Registered: May 2007
Member
The following code is compiled well if i ommit the line
dbms_output.put_line(v_type(j));

But with this line it gives error like pls-00306:wrong number or types of arguments in call to putline.

Then what should i do in order to see the contents which r stored in the associative array.

my table description is :-

SQL> desc foo;
Name Type Nullable Default Comments
---- ------------ -------- ------- --------
NM NUMBER Y
V VARCHAR2(20) Y

The code is:-

declare
cursor c1 is select t.nm v_nm,t.v v_v from foo t;
type p_type is table of c1%rowtype INDEX BY BINARY_INTEGER;
v_type p_type;
j INTEGER := 0;
begin
for i in c1 loop
j := j + 1;
v_type(j):=i;

dbms_output.put_line(v_type(j));
end loop;
end;

Can one give me the solution.

If i use dbms_output.put_line(v_type(j).v_nm||'-'||v_type(j).v_v); Then the problem is solved.Do u tell me any other way to it.

[Updated on: Thu, 12 July 2007 00:20]

Report message to a moderator

Re: problem on associative array [message #250968 is a reply to message #250950] Thu, 12 July 2007 01:43 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No other way, you have to follow the type of the parameters of the procedure.
It wants a string, you have to give it a string not a record.

Regards
Michel
Previous Topic: Pivot
Next Topic: pl/sql learner
Goto Forum:
  


Current Time: Sat Dec 03 18:31:54 CST 2016

Total time taken to generate the page: 0.22451 seconds