create table bill_payment (
billid varchar(5) primary key,
pid varchar(5),
amount float(7,2),
constraint bill_payment_pid_fk foreign key(pid) references patient_master(pid)
);
Asked
Active
Viewed 54 times
0

jarlh
- 42,561
- 8
- 45
- 63
-
float(7,2)? Is that a valid Oracle data type? Try numeric(7,2). – jarlh Oct 06 '16 at 09:44
-
`number(7,2)` * :) – sagi Oct 06 '16 at 09:45
-
1What does "silly platform" mean in the title? Also: when you look at an error message, try to understand what it is telling you. Your error message shows the exact line and position where the error is found, in this case on the line defining "amount" and right after the 7. If you post this additional information it will be that much easier to get answers from this forum. In this case the problem was easy, but when you have 40 lines of code it will be more difficult. Show the full error message. – Oct 06 '16 at 12:28
-
It is a very bad idea to use an approximate data type (type `float`) instead of a precise one (type `number`) when you can avoid it (which you usually can). See http://stackoverflow.com/questions/61872/use-float-or-decimal-for-accounting-application-dollar-amount – Thorsten Kettner Oct 06 '16 at 12:33
3 Answers
1
change float(7,2)
to float(2)
In case of float, only value of precision is required.
You can use Number(7,2)
also.

Harshil Doshi
- 3,497
- 3
- 14
- 37
0
It doesn't have to be that complex. And unless you are developing for the zimbabwean dollar the "number" type should do the trick.
You should also make some extra fields for future reference.
create table bill_payment
(
billid varchar (5) primary key,
pid varchar (5) references patient_master (pid),
amount number,
payment_date date
);

Olafur Tryggvason
- 4,761
- 24
- 30
0
Try to use
CREATE TABLE bill_payment
(
billid VARCHAR(5) PRIMARY KEY,
pid VARCHAR(5),
amount NUMBER(7, 2),
CONSTRAINT bill_payment_pid_fk FOREIGN KEY(pid) REFERENCES patient_master(pid)
);

Christian
- 827
- 6
- 14