fork download
  1. SET SERVEROUTPUT ON
  2.  
  3.  
  4. BEGIN
  5. DBMS_OUTPUT.put_line('hello world');
  6. END;
  7.  
  8.  
  9.  
  10. DECLARE
  11. message VARCHAR2(100):='Hello World';
  12. BEGIN
  13. DBMS_OUTPUT.put_line(message);
  14. END;
  15.  
  16.  
  17.  
  18. CREATE PROCEDURE CALC(x IN OUT NUMBER, y IN NUMBER, p OUT NUMBER)
  19. AS
  20. temp NUMBER(10);
  21. BEGIN
  22. TEMP:=x;
  23. x:=x+y;
  24. p:=temp-y;
  25. END;
  26. DECLARE
  27. a NUMBER(10):=23;
  28. b NUMBER(10):=25;
  29. diff NUMBER;
  30. BEGIN
  31. CALC(a,b,diff);
  32. DBMS_OUTPUT.put_line('the sum is ' || a || ' the difference is ' ||diff);
  33. END;
  34.  
  35.  
  36.  
  37.  
  38.  
Success #stdin #stdout #stderr 0.01s 5316KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: near line 1: near "SET": syntax error
Error: near line 6: cannot commit - no transaction is active
Error: near line 10: near "DECLARE": syntax error
Error: near line 12: near "DBMS_OUTPUT": syntax error
Error: near line 14: cannot commit - no transaction is active
Error: near line 18: near "PROCEDURE": syntax error
Error: near line 21: near "TEMP": syntax error
Error: near line 23: near "x": syntax error
Error: near line 24: near "p": syntax error
Error: near line 25: cannot commit - no transaction is active
Error: near line 26: near "DECLARE": syntax error
Error: near line 28: near "b": syntax error
Error: near line 29: near "diff": syntax error
Error: near line 30: near "CALC": syntax error
Error: near line 32: near "DBMS_OUTPUT": syntax error
Error: near line 33: cannot commit - no transaction is active