Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Select fails with ODP, works with OraOLEDB & Microsoft's Oracle Provider

25489Jun 22 2002
The following:

using System;
using System.Data;
using System.Text;
using Oracle.DataAccess.Client;

namespace Test
{
class Test
{
static void Main()
{
string connStr = "Data Source=xxx;User ID=yyy;Password=zzz";
OraConnection oraConn = new OraConnection(connStr);
DataSet myDS = new DataSet("ODPTest");
string tableName = "USER_TAB_COLUMNS";
string sql = "select TABLE_NAME, COLUMN_NAME, DATA_TYPE from USER_TAB_COLUMNS";
OraDataAdapter oraDA = new OraDataAdapter(sql, oraConn);
TimeSpan bgnTS = new TimeSpan(DateTime.Now.Ticks);
oraDA.Fill(myDS, tableName);
TimeSpan endTS = new TimeSpan(DateTime.Now.Ticks);
Console.WriteLine(endTS.Subtract(bgnTS).ToString());
Console.WriteLine("USER_TAB_COLUMNS rows: " + myDS.Tables[0].Rows.Count.ToString());
oraDA.Dispose();
oraConn.Close();

oraConn = new OraConnection(connStr);
myDS = new DataSet("ODPTest");
StringBuilder sqlSB = new StringBuilder("select c1, c2, c3 from (");
sqlSB.Append("select TABLE_NAME as c1, COLUMN_NAME as c2, DATA_TYPE as c3 ");
sqlSB.Append("from USER_TAB_COLUMNS ");
sqlSB.Append("order by 1, 2");
sqlSB.Append(") where rownum <= 20");
sqlSB.Append(" order by 1, 2");
oraDA = new OraDataAdapter(sqlSB.ToString(), oraConn);
bgnTS = new TimeSpan(DateTime.Now.Ticks);

try
{
oraDA.Fill(myDS, tableName);
}
catch (OraException e)
{
Console.WriteLine("");
Console.WriteLine("exception sql: " + oraDA.SelectCommand.CommandText);
Console.WriteLine("OraException.Procedure: " + e.Procedure);
Console.WriteLine("OraException.Source: " + e.Source);
Console.WriteLine("");

foreach (OraError oe in e.Errors)
{
Console.WriteLine("OraError.DataSource: " + oe.DataSource);
Console.WriteLine("OraError.Message: " + oe.Message);
Console.WriteLine("OraError.Number: " + oe.Number);
Console.WriteLine("OraError.Procedure: " + oe.Procedure);
Console.WriteLine("OraError.Source: " + oe.Source);
}

return;
}

endTS = new TimeSpan(DateTime.Now.Ticks);
Console.WriteLine(endTS.Subtract(bgnTS).ToString());
oraDA.Dispose();
oraConn.Close();
}
}
}

Returns:

00:00:03.2950337
USER_TAB_COLUMNS rows: 13361

exception sql: select c1, c2, c3 from (select TABLE_NAME as c1, COLUMN_NAME as c
2, DATA_TYPE as c3 from USER_TAB_COLUMNS order by 1, 2) where rownum <= 20 order
by 1, 2
OraException.Procedure: dvlp.cabana
OraException.Source: Oracle Data Provider for .NET

OraError.DataSource:
OraError.Message:
OraError.Number: -3002
OraError.Procedure: dvlp.cabana
OraError.Source: Oracle Data Provider for .NET
Press any key to continue


I'm connecting to an Oracle 9i instance running on W2K.
The code is running on a seperate W2K workstation with 9iR2 client installed
along with the OraOLEDB and Microsoft's production Oracle .NET data provider.

The select statement that fails with ODP works with SQL*Plus, OraOLEDB & Microsoft's provider.
Am I doing something wrong here or is this a problem with the provider?

Comments

user111989
Answer

Try to put and check if it reduces time. also check if it works for all the combination because we need target block for this to work

SET FRMLBOTTOMUP ON;

https://docs.oracle.com/cd/E57185_01/ESBTR/set_frmlbottomup.html

Marked as Answer by Zut Alors · Sep 27 2020
Jeo123

If you go to the logs when the calc is run, it'll tell you a bunch of useful things.  In particular, are you seeing notifications about calc mode being set to cell mode or something similar in there?

More importantly though, why not just agg the  geography dimension and then reference the total instead of doing a sum of the dimension on every entity?  Is there something in your app design that prevents that?

Zut Alors

@Jeo123

that's correct, aggregating a section of the dim would have helped, except there is some additional one-off calculation that need to occur

thanks,

cl

Zut Alors

that reduced the calc time by 80% - thank you!

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 23 2002
Added on Jun 22 2002
2 comments
312 views