Number was not inserted correctly by using ArrayInsertion

Number was not inserted correctly by using ArrayInsertion

Postby kiki » Tue 14 Jun 2011 21:55

Hello,

I found some number was not inserted correctly by using ArrayInsertion into a Float column. And this is only happens on 10g server but not 920.

Here's the table DDL

CREATE TABLE "NUMBERTEST"
(
"AKEY" NUMBER(*,0),
"AINT" NUMBER(*,0),
"ASIGNED" NUMBER(*,0),
"AFLOAT" NUMBER(*,0),
"ADOUBLE" FLOAT(126), "ADECIM" NUMBER(*,0),
"ADATE" TIMESTAMP (6),
"ACODE" NVARCHAR2(50),
"ANAME" NVARCHAR2(50),
"AADDRESS" NVARCHAR2(50) )


and here's data we are trying to insert ( first line is column header)

"AKEY","AINT","ASIGNED","AFLOAT","ADOUBLE","ADECIM","ADATE","ACODE","ANAME","AADDRESS"
59,968696870,193,-217171717,979797980,979797980,"1945-03-23 00:00:00","DhcSrGLl3Z","Xj:BmJUwN705kUt:KNyx","suikaSdgo"

You will find that 979797980 is turned into 979797952 when inserted by array insertion. If you use regular insert statement. it works fine.

Is this a bug in DevArt?
kiki
 
Posts: 7
Joined: Wed 23 Mar 2011 21:05

Postby Shalex » Fri 17 Jun 2011 15:25

Thank you for your report. We have reproduced the issue in the OCI mode. We will investigate it and notify you about the results as soon as possible. As a temporary workaround, please use the Direct mode.
Shalex
Devart Team
 
Posts: 7793
Joined: Thu 14 Aug 2008 12:44

Postby Shalex » Wed 22 Jun 2011 15:05

The type of the :ADOUBLE parameter should be OracleDbType.Number:
Code: Select all
    using (OracleConnection conn = new OracleConnection()) {
        conn.ConnectionString = "server=***;uid=***;pwd=***;";
        conn.Open();
        OracleCommand cmd = conn.CreateCommand();
        cmd.CommandText = "insert into numbertest values (:akey, :aint, :asigned, :afloat, :adouble, :adecim, :adate, :acode, :aname, :aaddress)";
               
        cmd.Parameters.Add("akey", OracleDbType.Integer).Value = new int[]{59};
        cmd.Parameters.Add("aint", OracleDbType.Integer).Value = new int[]{968696870};
        cmd.Parameters.Add("asigned", OracleDbType.Integer).Value = new int[]{193};
        cmd.Parameters.Add("afloat", OracleDbType.Integer).Value = new int[]{-217171717};
        cmd.Parameters.Add("adouble", OracleDbType.Number).Value = new int[]{979797980};
        cmd.Parameters.Add("adecim", OracleDbType.Integer).Value = new int[]{979797980};
        cmd.Parameters.Add("adate", OracleDbType.TimeStamp).Value = new OracleTimeStamp[]{new OracleTimeStamp(new DateTime(1945,03,23,00,00,00))};
        cmd.Parameters.Add("acode", OracleDbType.NVarChar).Value = new string[]{"DhcSrGLl3Z"};
        cmd.Parameters.Add("aname", OracleDbType.NVarChar).Value = new string[]{"Xj:BmJUwN705kUt:KNyx"};
        cmd.Parameters.Add("aaddress", OracleDbType.NVarChar).Value = new string[]{"suikaSdgo"};

        cmd.ExecuteArray(1);
        }}

Please try this code in your environment and notify us about the results.
Shalex
Devart Team
 
Posts: 7793
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle