today:
443
yesterday:
719
Total:
1,770,227

Technology

LOOP - 2

admin 2020.10.05 09:55 Views : 104

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;