-----------------------------------------------------------------
-- PL/SQL: DBMS_SQL - Query example continued (Section 4.9.2)   -
--         This anonymous block calls the driver procedures in  -
--         p21.sql                                              -
-- Chapter 4; Oracle Programming -- A Primer                    -
--            by R. Sunderraman                                 -
-----------------------------------------------------------------

DECLARE
 query_string varchar2(256);
 ncols number;
 column_types dsql.string9_table;
BEGIN
  query_string := 'select cno,cname,city from customers,zipcodes' ||
                  ' where customers.zip = zipcodes.zip';
  ncols := 3;
  column_types(1) := 'NUMBER';
  column_types(2) := 'VARCHAR2';
  column_types(3) := 'VARCHAR2';

  dsql_driver.drive_get_query_results(query_string,
                                  ncols,
                                  column_types);
END;
/
