fork download
  1. ```
  2. DECLARE
  3. v_regno VARCHAR2(10);
  4. v_name VARCHAR2(20);
  5. v_dob DATE;
  6. v_course VARCHAR2(20);
  7.  
  8. BEGIN
  9. v_regno := &regno; -- Input registerno from user
  10.  
  11. FOR rec IN (SELECT name, dob, course
  12. FROM students
  13. WHERE registerno = v_regno)
  14. LOOP
  15. v_name := rec.name;
  16. v_dob := rec.dob;
  17. v_course := rec.course;
  18.  
  19. DBMS_OUTPUT.PUT_LINE('Student Details:');
  20. DBMS_OUTPUT.PUT_LINE('Registerno: ' || v_regno);
  21. DBMS_OUTPUT.PUT_LINE('Name: ' || v_name);
  22. DBMS_OUTPUT.PUT_LINE('Date of Birth: ' || v_dob);
  23. DBMS_OUTPUT.PUT_LINE('Course: ' || v_course);
  24. END LOOP;
  25. END;
  26. ```
Success #stdin #stdout #stderr 0.01s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: near line 1: near "```
DECLARE
  v_regno  VARCHAR2(10);
  v_name    VARCHAR2(20);
  v_dob     DATE;
  v_course  VARCHAR2(20);

BEGIN
  v_regno := &regno;  -- Input registerno from user

  FOR rec IN (SELECT name, dob, course
                FROM students
                WHERE registerno = v_regno)
  LOOP
    v_name := rec.name;
    v_dob := rec.dob;
    v_course := rec.course;

    DBMS_OUTPUT.PUT_LINE('Student Details:');
    DBMS_OUTPUT.PUT_LINE('Registerno: ' || v_regno);
    DBMS_OUTPUT.PUT_LINE('Name: ' || v_name);
    DBMS_OUTPUT.PUT_LINE('Date of Birth: ' || v_dob);
    DBMS_OUTPUT.PUT_LINE('Course: ' || v_course);
  END LOOP;
END;
```": syntax error