DbMsSQL

to serve this class that I would use that has a few examples

This example does not require dynamic SQL using the text of the statement is known at the time of compilation., but it illustrates the basic concept underlying the whole. The DEMO procedure deletes all employees of the EMP table whose salary is higher than the compensation that you specify when you run DEMO .

Demo CREATE OR REPLACE PROCEDURE (salary in NUMBER) AS

cursor_name INTEGER;

rows_processed INTEGER;

BEGIN

cursor_name: = dbms_sql.open_cursor;

DBMS_SQL. PARSE (other cases, ' DELETE FROM emp sal WHERE >: x',)

DBMS_SQL. NATIVE);

DBMS_SQL. Bind_variable (all other cases ': x', salary);

rows_processed: = DBMS_SQL. Execute (cursor_name);

DBMS_SQL. CLOSE_CURSOR (cursor_name);

EXCEPTION

WHILE OTHERS THEN

DBMS_SQL. CLOSE_CURSOR (cursor_name);

DBMS_SQL

Tags: Database

Similar Questions

Maybe you are looking for