Advertisement
viktarb

TASK 6.1

Feb 6th, 2024 (edited)
1,371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.84 KB | None | 0 0
  1. -- mi metedo de programar el ejersicio
  2.  
  3. BEGIN
  4.     FOR counter IN 1 .. 10 LOOP
  5.         continue  WHEN   counter = 6
  6.         OR               counter = 8;
  7.         DBMS_OUTPUT.put_line(counter);
  8.         INSERT INTO messages (results)
  9.         VALUES (counter);
  10.     END LOOP;
  11.     COMMIT;
  12. END;
  13. /
  14.  
  15.  
  16. -- la solucion que viene en libro
  17. BEGIN
  18. FOR i IN 1..10 LOOP
  19.  IF i = 6 OR i = 8 THEN
  20.  NULL;
  21.  ELSE
  22.  INSERT INTO mess(results)
  23.  VALUES (i);
  24. END IF;
  25. END LOOP;
  26. COMMIT;
  27. END;
  28. /
  29.  
  30. -- aparte he creado la tabla
  31. CREATE TABLE mess AS dual;
  32. SELECT * FROM mess;
  33.  
  34.  
  35.  
  36. -- el error que da
  37.  
  38. Error report -
  39. ORA-06550: line 6, column 14:
  40. PL/SQL: ORA-00942: TABLE OR VIEW does NOT exist
  41. ORA-06550: line 6, column 2:
  42. PL/SQL: SQL Statement ignored
  43. 06550. 00000 -  "line %s, column %s:\n%s"
  44. *Cause:    Usually a PL/SQL compilation error.
  45. *Action:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement