troubleshooting Question

Unable to store the column values in a collection using select statement in oracle

Avatar of sam_2012
sam_2012 asked on
Oracle Database* Oracle PL/SQL
3 Comments1 Solution11 ViewsLast Modified:
Hi Team,

Below is the code, I have written to store the column values into a collection using a select statement. I am getting the below error, kindly help me in this regard. Any help is really appreciated.

CREATE TYPE enames_var IS VARRAY(200) OF VARCHAR2(30);


declare
l_empdata enames_var;
begin
select first_name into l_empdata
from employees;
end;
/
Error:

ORA-06550: line 4, column 8:
PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got CHAR
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros