Re: proplem writing function in PL/SQL

From: Vladimir Atanov <v-atanov_at_nmb.ru>
Date: 1996/10/09
Message-ID: <325AB2BF.5B0C_at_nmb.ru>#1/1


mwest_at_hort.cri.nz wrote:
>
> 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.
>

You must use package DBMS_SQL.
This package provides a means to use dynamic SQL to access the database.

Best Regards,
Vladimir Atanov ( v-atanov_at_nmb.ru ) Received on Wed Oct 09 1996 - 00:00:00 CEST

Original text of this message