fork download
  1. DECLARE
  2. n NUMBER := 12345; -- Replace with your desired number
  3. rev NUMBER := 0;
  4. r NUMBER;
  5. BEGIN
  6. WHILE num > 0 LOOP
  7. r := n MOD 10;
  8. rev := rev * 10 + r;
  9. n := n / 10;
  10. END LOOP;
  11.  
  12. DBMS_OUTPUT.PUT_LINE('Original Number: ' || TO_CHAR(n));
  13. DBMS_OUTPUT.PUT_LINE('Reverse Number: ' || TO_CHAR(rev));
  14. END;
  15. /
  16.  
Success #stdin #stdout #stderr 0.01s 5300KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: near line 1: near "DECLARE": syntax error
Error: near line 3: near "rev": syntax error
Error: near line 4: near "r": syntax error
Error: near line 5: near "WHILE": syntax error
Error: near line 8: near "rev": syntax error
Error: near line 9: near "n": syntax error
Error: near line 10: near "LOOP": syntax error
Error: near line 12: near "DBMS_OUTPUT": syntax error
Error: near line 13: near "DBMS_OUTPUT": syntax error
Error: near line 14: cannot commit - no transaction is active