I read from the table all_tab_columns, there is a column "data_default", which is a LONG type.
If I query the oracle server using sqlplus, for example, βselect data_default from all_tab_columns where table_name = 'testtable'", everything is fine. The correct default value for each column of the "testtable" table can be returned.
But if I use Oracle.ManagedDataAccess.dll (well, I use the Spartacus library, which in turn uses Oracle.ManagedDataAccess.dll), the data_default column always returns an empty row for the same query, '' I tried several others columns, such as column_name, table_name, owner, etc. are all in order.
My question is: how do I debug such a case? I could not find the root cause of this strange error. Any suggestion would be welcome.
Thank.
The source code for spartacus to read from oracle is as follows:
this.v_con = new OracleManaged.OracleConnection(this.v_connectionstring);
this.v_con.Open();
this.v_cmd = new OracleManaged.OracleCommand(p_sql, this.v_con);
if (this.v_timeout > -1)
this.v_cmd.CommandTimeout = this.v_timeout;
this.v_reader = this.v_cmd.ExecuteReader();
v_table = new System.Data.DataTable(p_tablename);
for (int i = 0; i < this.v_reader.FieldCount; i++)
v_table.Columns.Add(this.v_reader.GetName(i), typeof(string));
while (this.v_reader.Read())
{
v_row = v_table.NewRow();
for (int i = 0; i < this.v_reader.FieldCount; i++)
v_row[i] = this.v_reader[i].ToString();
v_table.Rows.Add(v_row);
}
I tried to debug, v_reader [i] .ToString () for the data_default column is already empty. It seems I canβt solve this? Is this a .dll problem?
source
share