proplem writing function in PL/SQL
From: <mwest_at_hort.cri.nz>
Date: 1996/10/03
Message-ID: <32532204.0_at_news.palm.cri.nz>#1/1
Date: 1996/10/03
Message-ID: <32532204.0_at_news.palm.cri.nz>#1/1
I have to following PL/SQL function:
FUNCTION NewVisitID (field_names IN varchar2)
RETURN number
IS
next_ID number;
BEGIN
select max(field_names) into next_ID from MIS.VISIT;
next_ID := next_ID + 1;
return(next_ID);
END;
I want the function to read in a field_name, run the select statement and
return the max +1 number.
I think the problem is that the select is trying to get the max of what i put into field_names rather than the max of the column specified in field_names. Can anyone provide a solution????????? Received on Thu Oct 03 1996 - 00:00:00 CEST