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!

Function return issue

2943907May 5 2015 — edited May 6 2015

Hello Gurus,

My requirement is to retrieve through function: if i pass string as parameter, it should return number value. I have tried below one, but it doesn't working.

CREATE OR REPLACE FUNCTION Get_Items_func(ItemName IN varchar(2000))
RETURN NUMBER IS
ItmID number;
BEGIN
SELECT ItemID into ItmID
FROM Items WHERE Item_Name = ItemName;
RETURN (ItmID);
END;

Please help me with this.

Thanks in Advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 3 2015
Added on May 5 2015
11 comments
268 views