I have an Oracle function with one argument. I need to call it from PowerBuilder. Is this possible? If so, how? Thanks!
My function:
CREATE OR REPLACE FUNCTION OPEN.F_VALIDATION (f_date DATE)
RETURN NUMBER
IS
v_an number;
v_debug_line varchar2(20);
BEGIN
/*some relevant code - delete, selects, updates, inserts*/
DBMS_OUTPUT.put_line ('OK');
COMMIT;
RETURN v_an;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('v_debug_line: ' || v_debug_line);
DBMS_OUTPUT.put_line (
'ERROR: ' || SQLERRM);
ROLLBACK;
DBMS_OUTPUT.put_line ('ERROR');
RETURN v_an;
END F_VALIDATION ;
Another way to call an Oracle function in PowerBuilder, assuming your app is already connected to the database:
long l_rc
date d_date = today()
SELECT open.f_validation( :d_date )
INTO :l_rc
FROM dual;
if sqlca.sqlcode <> 0 then
messagebox( "Exception", "Unable to validate:~r~n" + sqlca.sqlerrtext )
end if