I want to write a function that calculates a number.
create or replace function POS (ln_pos is NUMBER)
RETURN NUMBER IS
v_pos number;
BEGIN
v_pos := ln_pos * 300;
end;
Here is a skeleton of my procedure. Where eould I put the function? Did I bui;d it correctly?
SET SERVEROUTPUT ON
SET DEFINE OFF
CREATE OR REPLACE PROCEDURE chqtest1 IS
.. variables ..
BEGIN
.. body ...
dbms_output.put_line(POS(4.32));
EXCEPTION
... exceptions ...
END;
/
SET SERVEROUTPUT OFF
SET DEFINE ON
----- output ----
1296
create or replace function POS (ln_pos is NUMBER)
RETURN NUMBER IS
v_pos number;
BEGIN
v_pos := ln_pos * 300;
end;
Here is a skeleton of my procedure. Where eould I put the function? Did I bui;d it correctly?
SET SERVEROUTPUT ON
SET DEFINE OFF
CREATE OR REPLACE PROCEDURE chqtest1 IS
.. variables ..
BEGIN
.. body ...
dbms_output.put_line(POS(4.32));
EXCEPTION
... exceptions ...
END;
/
SET SERVEROUTPUT OFF
SET DEFINE ON
----- output ----
1296