![]() |
Oracle 10g
hi....
could anybody help me??? oracle is driving me to maddness :@... for project i have to create tables and indetify their primary keys and foreign keys so i entered values for primary keys in this part everything went good... but for other fields, i couldn't if i typed this code :
and for this code it gave me not enough values :
i am lost i have to finish this database soon :'( |
Re: Oracle 10g
What does this return:
desc tbl_lease; |
Re: Oracle 10g
the fields' names and data type
|
Re: Oracle 10g
I think IR was looking for you to post the output of
desc tbl_lease; |
Re: Oracle 10g
?????????????:?:
|
Re: Oracle 10g
Hah. We need to see the results of that 'desc' command in order to help you.
|
Re: Oracle 10g
|
Re: Oracle 10g
Your first problem regarding the missing comma is because the RENTAL_AMOUNT is defined
as "120 000", there is no such value that is a number. You have use a comma or remove the space: 120,000 or 120000. The insert command you listed will still fail after you fix the comma problem, with your next problem regarding the amount of values. Your table has 6 fields, you only supply 5 values. My assumption is that you left out the LEASE_NAME value in your insert statement, so just append that on the end of your insert statement and it will work. For example: INSERT INTO tbl_lease (lease_name, rental_amount, lease_signdate, begin_date, end_date) VALUES ('Gardern1', '120000', '1-Jan-2008', '10-Jan-2008', '10-Jan-2009','Test'); I simply removed the space from the RENTAL_AMOUNT and added a value (Test) for LEASE_NAME. |
Re: Oracle 10g
first i tried insert command for lease_id to check if it is going to work or not so it worked but when i tried to add other values it didn't work, notice that i selected the fields.... so should i drop the tables and create them again?? would that fix the problem??
|
Re: Oracle 10g
Sorry for my initial posts... they were a bit inaccurate. I missed the part where you were defining which rows you wanted to insert into. I think a large part of your problem is that the numeric you are entering for rental_amount is enclosed in quotes (its not a string, so they need to be removed), the space in the rental_amount still needs to be removed, then you will need to make sure your dates are in the correct format that Oracle expects.
I recreated your table in MySQL and added a line to test... :
mysql> desc tbl_lease; |
| All times are GMT -5. The time now is 10:02 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC