today:
413
yesterday:
400
Total:
1,744,763

Technology

LOOP - 2

admin 2020.10.05 09:55 Views : 101

DECLARE 

 

CUSTOMER_NAME VARCHAR2(100);

CUSTOMER_EMAIL VARCHAR2(100);

CUSTOMERNAME VARCHAR2(100);

CUSTOMEREMAIL VARCHAR2(100);

 

EMAIL_LIST VARCHAR2(100);

EMAIL_COUNT NUMBER;

 

BEGIN

 

 SELECT COUNT(*) INTO EMAIL_COUNT FROM CUSTOMERS; 

 FOR i IN 1..EMAIL_COUNT 

 

LOOP 

  SELECT  CUSTOMER_NAME into CUSTOMERNAME FROM CUSTOMERS WHERE ID = i;

  SELECT  CUSTOMER_EMAIL into CUSTOMEREMAIL FROM CUSTOMERS WHERE ID = i;

  DBMS_OUTPUT.PUT_LINE ( CUSTOMERNAME || CUSTOMEREMAIL );

 

END LOOP;

 

END;