0

Everything is OK if I have one out parameter in stored procedure. Now I would like to output two of them. Could you help me? What is wrong?

CREATE OR REPLACE PROCEDURE PROC1(p_product_id IN products.product_id%TYPE, 
p_name OUT products.name%TYPE, p_description OUT products.description%TYPE)
AS BEGIN
SELECT PRODUCTS.NAME, PRODUCTS.DESCRIPTION INTO p_name, p_description FROM 
PRODUCTS WHERE PRODUCTS.product_id = p_product_id;
END;

I would like to call this procedure and get output result of p_name and p_description.

DECLARE
 nazwa VARCHAR2(30),
 opis  VARCHAR2(50);
BEGIN
PROC1(1, nazwa, opis);
dbms_output.put_line(nazwa);
dbms_output.put_line(opis);
END;

I got an error. "Rrror report - ORA-06550: line 2, column 19: PLS-00103: Encountered "," expected: := ; not null default character 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error."

Jawor
  • 13
  • 5

1 Answers1

0

nazwa VARCHAR2(30), opis VARCHAR2(50);

you can see the line 2 error go to line 2 you see nazwa VARCHAR2(30), it should be nazwa VARCHAR2(30);

Alak
  • 1
  • 1
  • 3
  • Right, I got used to T-SQL, that's why I made the mistake. On the other hand, the error is very clear. – Jawor Feb 16 '18 at 12:04