-- dynamic_bind2.sql

SET SERVEROUTPUT ON

DECLARE
   c INTEGER;
   r INTEGER;
BEGIN
   c := DBMS_SQL.OPEN_CURSOR;
   DBMS_SQL.PARSE(c, 'UPDATE employee SET pay_amount = pay_amount * 1.1 ' ||
      ' WHERE store_number = :sn AND pay_type_code = :ptc', DBMS_SQL.NATIVE);
   DBMS_SQL.BIND_VARIABLE(c, ':sn', 7);
   DBMS_SQL.BIND_VARIABLE(c, ':ptc', 'S');
   r := DBMS_SQL.EXECUTE(c);
   DBMS_OUTPUT.PUT_LINE(r || ' rows updated.');
END;
/
