Home » SQL & PL/SQL » SQL & PL/SQL » Error MS
Error MS [message #235487] Sun, 06 May 2007 17:55 Go to next message
vickie2405
Messages: 27
Registered: May 2007
Location: California, US
Junior Member

I try to calculate the Amount Due = Unit Price * Order Quanity. I put the formula into the select statment, but it did not work. I tried many ways already and still get stuck. Can some one here help me. Thanks a lot.

Below is the error message.


Enter the Quantity to be Ordered: 23
old 1: select ' Unit Price: ' ||rtrim(Unitprice) ||'' from Price where Inum='&vInum'
new 1: SELECT ' UNIT PRICE: ' ||RTRIM(UNITPRICE) ||'' FROM PRICE WHERE INUM='101'

UNIT PRICE: 2

1 row selected.

old 1: insert into OrderDetail (UnitPrice) select Unitprice from Price where Inum='&vInum'
new 1: INSERT INTO ORDERDETAIL (UNITPRICE) SELECT UNITPRICE FROM PRICE WHERE INUM='101'
INSERT INTO ORDERDETAIL (UNITPRICE) SELECT UNITPRICE FROM PRICE WHERE INUM='101'
*
ERROR at line 1:
ORA-01400: cannot insert NULL into ("SYSTEM"."ORDERDETAIL"."ONUM")


old 1: select ' Amount Due: ' , Unitprice*'&vOrderqty' from OrderDetail
new 1: SELECT ' AMOUNT DUE: ' , UNITPRICE*'23' FROM ORDERDETAIL

no rows selected
Re: Error MS [message #235492 is a reply to message #235487] Sun, 06 May 2007 20:35 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
Please read & FOLLOW the #1 Sticky post at the top of this forum.

What gets returned from:
SELECT COUNT(*) FROM PRICE WHERE INUM='101'
Re: Error MS [message #235493 is a reply to message #235492] Sun, 06 May 2007 20:53 Go to previous message
vickie2405
Messages: 27
Registered: May 2007
Location: California, US
Junior Member

thanks Anacedent a lot for your help.
I figured it out already.
Previous Topic: login with hyperlink?
Next Topic: Audit_trail=DB
Goto Forum:
  


Current Time: Sun Dec 11 00:18:42 CST 2016

Total time taken to generate the page: 0.09828 seconds