Figure 6: Multiple SQL statements for multiple objects
DECLARE CURSOR cursor1 FOR SELECT custid FROM orders WHERE ord_date = ‘11/03/2008’; OPEN cursor1; Do READ cursor1 INTO :v_custid; SELECT cust_name, cust_address INTO :v_name, :v_addr FROM customers WHERE custid= :v_custid; /* Process customer data */ … Until no more rows found; CLOSE cursor1;