Oracle
 sql >> Teknologi Basis Data >  >> RDS >> Oracle

Cara mendapatkan dua nilai pengembalian dari Oracle Stored Procedure

-- 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;
/

keluaran:150 20



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Bagaimana menerapkan hubungan satu-ke-satu, satu-ke-banyak dan banyak-ke-banyak saat mendesain tabel?

  2. 50 Nuansa Ujian Sertifikasi Database Oracle

  3. Kesalahan prosedur tersimpan PLS-00201:pengenal 'UTL_HTTP' harus dideklarasikan

  4. Fungsi NLS_LOWER() di Oracle

  5. Buat prosedur tersimpan dengan tabel dari skema lain lemparan PLS-00201