Using sql type with cursor in plsql block [message #242134] |
Thu, 31 May 2007 14:22 |
rolex.mp
Messages: 161 Registered: February 2007
|
Senior Member |
|
|
I wanted to bulk collect columns in a table into a sqltype .I cannot use plsql type here since I am using it with table function in a merge statement.
Sample code is like this
create type t_type as object(empno number);
create type tab_type as table of t_type;
declare
t1 tab_type;
begin
select empno bulk collect into t1;
end;
/
I get an error like
ORA-00932: inconsistent datatypes: expected UDT got number
Pls suggest some alternative
[Updated on: Thu, 31 May 2007 14:27] Report message to a moderator
|
|
|
|
Re: Using sql type with cursor in plsql block [message #242173 is a reply to message #242134] |
Thu, 31 May 2007 21:33 |
rolex.mp
Messages: 161 Registered: February 2007
|
Senior Member |
|
|
1 declare
2 t1 tab_type;
3 begin
4 select empno bulk collect into t1 from emp;
5 end;
/
I get an error like
ERROR at line 4:
ORA-06550: line 4, column 8:
PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got NUMBER
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored
Pls suggest some alternative
|
|
|
|
|