问题描述
在我的C#程序中,我有一段代码来创建Oracle表。该表有两个字段,X和Y,它们应该是数据类型的double。如果我设置... X double,Y double,...,我收到一个错误:ORA-00905:缺少关键字。但是,如果我将数据类型更改为十进制,则代码会通过。然后,当我动态地将记录插入表中时,保存的X& Y值是表中的整数值,而不是双原始源。表中X / Y的数据类型是Number。如何解决这个问题?提前致谢。
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.
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) )
推荐答案
这篇关于创建一个oracle表 - Double / Decimal中的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!