Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 22nd, 2005, 10:27 AM
stevensys stevensys is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 12 stevensys User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 35 m 36 sec
Reputation Power: 0
Unhappy update SQL not working

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??

Reply With Quote
  #2  
Old March 22nd, 2005, 10:34 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,826 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 1 Day 9 h 59 m 53 sec
Reputation Power: 278
Move this thread to the Oracle forum, this is about MySQL

Reply With Quote
  #3  
Old March 23rd, 2005, 12:04 AM
stevensys stevensys is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 12 stevensys User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 35 m 36 sec
Reputation Power: 0
Quote:
Originally Posted by pabloj
Move this thread to the Oracle forum, this is about MySQL


How do i move this thread to the oracle forum?

Reply With Quote
  #4  
Old March 23rd, 2005, 01:36 AM
lnxgeek lnxgeek is offline
I AM A GOLDEN GOD
Dev Shed God (5000 - 5499 posts)
 
Join Date: Apr 2003
Location: cannot find symbol: method showLocation()
Posts: 5,419 lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 16 h 38 m 54 sec
Reputation Power: 685
Uh, pabloj can't you move it? Or does a MySQL mod have to do that?
__________________
BookMooch.com : Give books away. Get books you want.

Reply With Quote
  #5  
Old March 23rd, 2005, 07:01 AM
Guelphdad's Avatar
Guelphdad Guelphdad is offline
Headed to unemployment
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Guelph Canada
Posts: 7,137 Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 2 Months 1 Week 6 Days 12 h 11 m 29 sec
Reputation Power: 623
Quote:
Originally Posted by stevensys
How do i move this thread to the oracle forum?

You can click the red triangle at the top right of your post. In the message just let the moderator know you have put it in the incorrect forum and please move it to appropriate forum for you.

Reply With Quote
  #6  
Old March 23rd, 2005, 07:06 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,826 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 1 Day 9 h 59 m 53 sec
Reputation Power: 278
Sorry for the late answer, I can't move it, a mod of MySQL forum or the author must move it.

Reply With Quote
  #7  
Old March 23rd, 2005, 07:09 AM
Guelphdad's Avatar
Guelphdad Guelphdad is offline
Headed to unemployment
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Guelph Canada
Posts: 7,137 Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level)Guelphdad User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 2 Months 1 Week 6 Days 12 h 11 m 29 sec
Reputation Power: 623
Quote:
Originally Posted by lnxgeek
Uh, pabloj can't you move it? Or does a MySQL mod have to do that?

I think Rudy said that you had to be a moderator of that particular forum the question is in, before you could move it to another forum.

Last edited by Guelphdad : March 23rd, 2005 at 07:15 AM.

Reply With Quote
  #8  
Old March 23rd, 2005, 08:29 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,690 r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 6 Days 16 h 20 m
Reputation Power: 985
moved
__________________
r937.com | rudy.ca

Reply With Quote
  #9  
Old March 23rd, 2005, 05:16 PM
lnxgeek lnxgeek is offline
I AM A GOLDEN GOD
Dev Shed God (5000 - 5499 posts)
 
Join Date: Apr 2003
Location: cannot find symbol: method showLocation()
Posts: 5,419 lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 16 h 38 m 54 sec
Reputation Power: 685
Ok now that we've all detracted from the topic enough, can someone help this poor soul?

Reply With Quote
  #10  
Old March 23rd, 2005, 05:52 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,690 r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 6 Days 16 h 20 m
Reputation Power: 985
well, i'm not really all that familiar with oracle procedures (in fact, not at all), but the actual UPDATE statement itself looks plenty wonky

if i'm reading it right, all the assignments need to be flipped over

so instead of setting v_salary to be equal to salary, it should be setting salary to be equal to v_salary



oh, and there should probably be a WHERE clause, otherwise the same values will update every row in the table


Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > update SQL not working


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |