Updating using cursor oracle
create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: ,625.00 Employee: 2 Department: 41 New Salary:
create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,522.50 Employee: 3 Department: 31 New Salary:create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,540.00 Employee: 4 Department: 10 New Salary:create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,522.50 Employee: 5 Department: 50 New Salary:create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,705.00 Employee: 6 Department: 41 New Salary:create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,260.00 Employee: 7 Department: 41 New Salary:create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,312.50 Employee: 8 Department: 41 New Salary:create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,155.00 Employee: 9 Department: 41 New Salary:create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,365.00 Employee: 10 Department: 41 New Salary:create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
||create table Employee( 2 ID VARCHAR2(4 BYTE) NOT NULL primary key, 3 First_Name VARCHAR2(10 BYTE), 4 Last_Name VARCHAR2(10 BYTE), 5 Start_Date DATE, 6 End_Date DATE, 7 Salary Number(8,2), 8 City VARCHAR2(10 BYTE), 9 Description VARCHAR2(15 BYTE) 10 ) 11 / Table created.
SQL select * from Employee 2 / ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester 03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester 04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager 05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester 06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester 07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager 08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester 8 rows selected.
CREATE TABLE employee 2 (employee_id NUMBER(7), 3 last_name VARCHAR2(25), 4 first_name VARCHAR2(25), 5 userid VARCHAR2(8), 6 start_date DATE, 7 comments VARCHAR2(255), 8 manager_id NUMBER(7), 9 title VARCHAR2(25), 10 department_id NUMBER(7), 11 salary NUMBER(11, 2), 12 commission_pct NUMBER(4, 2) 13 ); Table created.
SQL DECLARE 2 CURSOR emp Cursor IS 3 SELECT employee_id, department_id, NVL(salary,0) salary, ROWID 4 FROM employee; 5 lv_record_num PLS_INTEGER DEFAULT 0; 6 BEGIN 7 FOR emp Record IN emp Cursor LOOP 8 lv_record_num := lv_record_num 1; 9 IF emp Record.department_id = 10 OR 10 emp Record.department_id = 41 THEN 11 IF emp Record.salary 2000 THEN 24 emp Record.salary := emp Record.salary * 1.05; 25 ELSE 26 emp Record.salary := emp Record.salary * 1.10; 27 END IF; 28 END IF; 29 UPDATE employee 30 SET salary = emp Record.salary 31 WHERE rowid = emp Record. PUT_LINE(); 43 ROLLBACK; 44 END; 45 / Employee: 1 Department: 50 New Salary: $2,625.00 Employee: 2 Department: 41 New Salary: $1,522.50 Employee: 3 Department: 31 New Salary: $1,540.00 Employee: 4 Department: 10 New Salary: $1,522.50 Employee: 5 Department: 50 New Salary: $1,705.00 Employee: 6 Department: 41 New Salary: $1,260.00 Employee: 7 Department: 41 New Salary: $1,312.50 Employee: 8 Department: 41 New Salary: $1,155.00 Employee: 9 Department: 41 New Salary: $1,365.00 Employee: 10 Department: 41 New Salary: $1,372.35 Update Process Complete.
Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
,372.35 Update Process Complete.Command Type = 4 'ad Cmd Stored Proc Dim param1 Set param1 = cmd.
When i run the below SQL i am getting the following errordeclarecursor c1 is SELECT emp_num,retention_id FROM tarner.nexros b;beginfor i in c1 loop UPDATE en.agt_name a SET a.emp_num =b.emp_numwhere a.userid = b.retention_id;commit;end loop;end; Error: ORA-06550: line 3, column 13: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 2, column 14: PL/SQL: SQL Statement ignored ORA-06550: line 9, column 11: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 1: Please help me out!!
If the statement doesn’t identify any rows to be fetched, Oracle Database will raise the NO_DATA_FOUND exception.
However, you must explicitly close package-based cursors.At the end of the article, I offer some quick tips to help you figure out which of these techniques you should use for different scenarios.SELECT-INTO SELECT-INTO offers the fastest and simplest way to fetch a single row from a SELECT statement. If the SELECT statement identifies more than one row to be fetched, Oracle Database will raise the TOO_MANY_ROWS exception.CREATE OR REPLACE PROCEDURE get_emp_rs (p_deptno IN emp.deptno%TYPE, p_recordset OUT SYS_REFCURSOR) AS BEGIN OPEN p_recordset FOR SELECT ename, empno, deptno FROM emp WHERE deptno = p_deptno ORDER BY ename; END Get Emp RS; / Dim conn, cmd, rs Set conn = Server. Open "DSN=TSH1; UID=scott; PWD=tiger" Set cmd = Server. Create Parameter ("deptno", ad Integer, ad Param Input) cmd.
Search for updating using cursor oracle:

SQL DECLARE 2 CURSOR employee_cur IS 3 SELECT * FROM employee 4 FOR UPDATE OF salary; 5 BEGIN 6 FOR employee_rec IN employee_cur 7 LOOP 8 UPDATE employee 9 SET salary = 10000 10 WHERE CURRENT OF employee_cur; 11 END LOOP; 12 END; 13 / PL/SQL procedure successfully completed.
We have already helped thousands of Arab singles worldwide in finding their love and someone to share their lives with.
Beardatinggay and ncswinger, from catholicdatingservices to simrpgdatinggames of the freepicturelargeswingerorgy, to geoknightjetpress9x12swinger and advicebbcdating.
Tip 7: Citing Characters from Books, Movies, or Cartoons If you want a girl who is trendy and/or smart, then use your favorite characters smartly in your headline.