-- IN arguments : you get them. You can modify them locally but caller won't see it
-- IN OUT arguments: initialized by caller, already have a value, you can modify them and the caller will see it
-- OUT arguments: they're reinitialized by the procedure, the caller will see the final value.
CREATE PROCEDURE f (p IN NUMBER, x IN OUT NUMBER, y OUT NUMBER)
IS
BEGIN
x:=x * p;
y:=4 * p;
END;
/
SET SERVEROUTPUT ON
declare
foo number := 30;
bar number := 0;
begin
f(5,foo,bar);
dbms_output.put_line(foo || ' ' || bar);
end;
/
wyjścia: 150 20
"więcej niż jeden" _horizontally_ (to znaczy wiele pól) albo _vertically_ (kilka rzędów)? –
funkcje mogą zwrócić tylko jeden obiekt. Ale może być złożonego typu ('TABELA jakiejś klasy'). Ale może chciałbyś skorzystać z procedur? – Benoit
Mój SP zwróci dwie wartości. Dlatego nie wiem, jak uzyskać te dwie wartości zwrotu z mojego SP. – ppshein