Click here to Skip to main content
15,897,315 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In my C# program, I have a piece of code to create an Oracle table. The table has two fields, X and Y, which should be in double in data type. If I set " ... X double, Y double, ...", I receive an error: ORA-00905: missing keyword. However, if I changed the data type as decimal, it code went through. Then, when I insert records into the table dynamically, the saved X & Y values are integer values in the table rather than as double original source. The data type of X/Y in the table is Number. How can this problem be fixed? Thanks in advance.
C#
using (OracleCommand cmd = new OracleCommand( "create table " + tblName +
    "(  IIT Varchar2(7) NOT NULL, ETime Number, TrainID Number, CarNo Number, " +
    "   DestinationNo Number, TrkID Varchar2(12), TrackName Varchar2(2), " +
    "   Others Varchar2(10), X decimal, Y decimal  )", connection) )
Posted
Comments
s yu 9-Jul-14 11:35am    
Searched and then changed the data type as Binary_Double. Then it went through.

1 solution

I'm not sure if DOUBLE is a valid data type in Oracle. Try FLOAT or NUMBER instead.
 
Share this answer
 
Comments
s yu 8-Aug-14 12:38pm    
Yes. Use Number. Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900