plsql [message #599572] |
Sat, 26 October 2013 04:57 |
|
saturnel
Messages: 8 Registered: October 2013
|
Junior Member |
|
|
Good morning everybody
please i try to execute this code but i have an error please help me to solve my pb i don't understand please
clear screen
set serveroutput on;
declare
empno employees.employee_id%type:=100;
begin
merge into copy_emp c
using employees e
on (e.employee_id = c.empno)
when matched then
update set
c.firstname = e.firstname,
c.last_name = e.lastname,
c.email= e.email,
c.phone_number = e.phone_number,
c.hire_date = e.hire_date,
c.job_id = e.job_id,
c.salary = e.salary,
c.commission_pct = e.commission_pct,
c.manager_id = e.manager_id,
c.department_id = e.department_id;
when no matched then
insert values(e.employee_id, e.firstname, e.lastname, e.email, e.phone_number, e.hire_date, e.job_id, e.salary,
e.commission_pct, e.manager_id, e.manager_id, e.department_id);
end;
/
Error report:
ORA-06550: line 23, column 5:
PLS-00103: Encountered the symbol "WHEN" when expecting one of the following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
|
|
|
|
|
|