SQL>
SQL> CREATE OR REPLACE FUNCTION updnval (
2 col IN VARCHAR2
3 , val IN NUMBER
4 , start_in IN DATE
5 , end_in IN DATE
6 )
7 RETURN PLS_INTEGER
8 IS
9 BEGIN
10 EXECUTE IMMEDIATE 'UPDATE employee SET '
11 || col
12 || ' = :the_value
13 WHERE hire_date BETWEEN :lo AND :hi'
14 USING val, start_in, end_in;
15
16 RETURN SQL%ROWCOUNT;
17 END;
18 /
Function created.
SQL>
SQL>
|