Index | Home | Forums
Oracle PL/SQL Example 4-13 Specifying a LOOP Range at Run Time

Example 4-13 Specifying a LOOP Range at Run Time

CREATE TABLE temp (emp_no NUMBER, email_addr VARCHAR2(50));
DECLARE
  emp_count NUMBER;
BEGIN
  SELECT COUNT(employee_id) INTO emp_count FROM employees;
  FOR i IN 1..emp_count LOOP
   INSERT INTO temp VALUES(i, 'to be added later');
  END LOOP;
  COMMIT;
END;
/


This page was generated on/at Feb 23,2008 00:20:12
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here




Index | Home | Forums
Oracle PL/SQL Example 4-13 Specifying a LOOP Range at Run Time

Example 4-13 Specifying a LOOP Range at Run Time

CREATE TABLE temp (emp_no NUMBER, email_addr VARCHAR2(50));
DECLARE
  emp_count NUMBER;
BEGIN
  SELECT COUNT(employee_id) INTO emp_count FROM employees;
  FOR i IN 1..emp_count LOOP
   INSERT INTO temp VALUES(i, 'to be added later');
  END LOOP;
  COMMIT;
END;
/


This page was created by oracleabc.com on Feb 23,2008 00:09:02
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here