Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SELECT * INTO x

882607Aug 16 2011 — edited Aug 16 2011
Hello,

i got a problem with a PL/SQL function. I have two UDTs

AddressType(street varchar, zip integer, ...
PersonType(name varchar, address AddressType, ...

Now i need a PL/SQL function that encapsulates the following select: "SELECT * FROM Person WHERE name = 'Michael Knight'; ". Here is what i have:

create or replace function GetPerson
return Person%ROWTYPE as
data t_Person;
BEGIN
SELECT * INTO data FROM Person where name = 'Michael Knight';
return data;
END;

Im getting error ORA-00947: Not enough values

I guess the problem is the address field but how can a select the UDT field into my variable?

thx in advance

Edited by: user13529112 on Aug 16, 2011 6:58 AM

Edited by: user13529112 on Aug 16, 2011 6:59 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 13 2011
Added on Aug 16 2011
6 comments
345 views