The steps involved to execute an insert, delete or update statement are as follows:
handle := DBMS_SQL.OPEN_CURSOR;
procedure parse(handle IN INTEGER, stmt IN VARCHAR2, language IN INTEGER);language is one of the following constants
procedure bind_variable(handle IN INTEGER, name IN VARCHAR2, value IN NUMBER); procedure bind_variable(handle IN INTEGER, name IN VARCHAR2, value IN VARCHAR2); procedure bind_variable(handle IN INTEGER, name IN VARCHAR2, value IN DATE); procedure bind_variable_char(handle IN INTEGER, name IN VARCHAR2, value IN CHAR); Examples: DBMS_SQL.BIND_VARIABLE(handle,':n',10); DBMS_SQL.BIND_VARIABLE(handle,':n',enum); DBMS_SQL.BIND_VARIABLE(handle,':c','Jones'); DBMS_SQL.BIND_VARIABLE(handle,':c',ename); DBMS_SQL.BIND_VARIABLE(handle,':d',hdate);
nrows := DBMS_SQL.EXECUTE(handle);
DBMS_SQL.CLOSE_CURSOR(handle);