|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi, my update sql here not working, already try many steps but it come out error.
below is my SQL plus code Code:
create or replace procedure updateinstructor
(v_salary number, date_hired varchar2, v_insrucid number, v_instrucname varchar2, v_commission number, v_mentorid number) is
begin
IF v_salary <= 3500 or MONTHS_BETWEEN(SYSDATE, to_date(date_hired,'dd-mon-yyyy') ) / 12 <= 21
THEN
RAISE_APPLICATION_ERROR (-20501, 'Inserting Record Failure, only Mentor that work more than 21 years or salary more than 3500 can act as mentor');
else
update INSTRUCTOR
set v_salary = salary
,date_hired = date_hired
,v_insrucid = instructor_id
,v_instrucname = instructor_name
,v_commission = commission
,v_mentorid = mentor_id;
end if;
end updateinstructor;
/
somehow it come out error as below. ********************** LINE/COL ERROR -------- ----------------------------------------------------------------- 8/5 PL/SQL: SQL Statement ignored 9/6 PL/SQL: ORA-01733: virtual column not allowed here ************************ and below is my table desc. SQL> desc instructor Name Null? Type ----------------------------------------- -------- -------------------- INSTRUCTOR_ID NOT NULL NUMBER(3) INSTRUCTOR_NAME VARCHAR2(15) SALARY NUMBER(6,2) COMMISSION NUMBER(6,2) MENTOR_ID NUMBER(3) DATE_HIRED DATE please help me out?? |
|
#2
|
|||
|
|||
|
It should be the other way round in the set clause.
Code:
set salary = v_salary et.c. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Update SQL error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|