Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Generic function to test for a returned value in a select statement?
Hi,
I am attempting to create a function that will return a value based on the
results on a select statement within the function...I would like it to be
'generic', that is I want to be able to pass the table name, the value to check
for and the value to check against to the function...like this
retval1 varchar2(1);
BEGIN
select 'Y' into retval1 from dual where exists
(select testkey from tblname where testkey = testval) ;
if retval1 = 'Y' then
RETURN 'True';
else
RETURN 'False' ;
end if;
END;
When I try to compile this it fails because tblname is not a table name ( since I have not passed it a value ) ...
Am I on the wrong track here ? Can this be done...
Thanks for any help, or pointers ...
John Greco
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==---------- http://www.newsfeeds.com The Largest Usenet Servers in the World! ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==----- Received on Fri Nov 05 1999 - 12:38:51 CST
![]() |
![]() |