PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET possible bug in oracleclient

Reply

possible bug in oracleclient

 
Thread Tools Rate Thread
Old 10-04-2006, 09:15 PM   #1
jamesd
Guest
 
Posts: n/a
Default possible bug in oracleclient


I believe I may be encountering a bug in the way
System.Data.OracleClient is issuing commands:

The following code you will see that the CommandText is different.



OracleConnection con = new OracleConnection();
con.ConnectionString = SelectConnectionStringOracle();
con.Open();
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "select * from kellya.GEMSDATA WHERE
ROWNUM <= 10";//RETURNS NO RECORDS
cmd.CommandText = "select * from irdb.GRANTS WHERE ROWNUM
<= 10";//WORKS GREAT

cmd.CommandType = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
Debug.WriteLine(dt.Rows.Count);
con.Close();
return dt;

The "kellya.GEMSDATA" returns no records, it only returns an empty
datatable with the column names, BUT no datarows. Even though when I
use oracle TOAD to select records it returns all the records! So I know
that the data is there, it just won't return the rows.

If it matters, kellya.GEMSDATA is a temp table in oracle that I
created, and I am logged in as kellya

To reiterate, when .NET/OracleClient issues command "select * from
kellya.GEMSDATA WHERE ROWNUM <= 10" no rows are returned, but a SqlPlus
and Toad return rows when that command is issued.



Please help, this is driving me crazy for too many days now. I have
tried everything I can think of.

  Reply With Quote
Old 10-04-2006, 09:55 PM   #2
Jeff Dillon
Guest
 
Posts: n/a
Default Re: possible bug in oracleclient

"Temp table"? Looks like a permanent table to me...although I only work with
SQL Server

But 10 seconds on Google via "temp table oracle"

Create global temporary table tempTable
(
id number,
value number
);

This creates a table that is visible to all sessions, but only the data
placed in the table is visible for the current working session. The temp
table is resident until the session that created it is closed


"jamesd" <jamesd@ring4freedom.com> wrote in message
news:1144700100.568062.80560@v46g2000cwv.googlegroups.com...
>I believe I may be encountering a bug in the way
> System.Data.OracleClient is issuing commands:
>
> The following code you will see that the CommandText is different.
>
>
>
> OracleConnection con = new OracleConnection();
> con.ConnectionString = SelectConnectionStringOracle();
> con.Open();
> OracleCommand cmd = con.CreateCommand();
> cmd.CommandText = "select * from kellya.GEMSDATA WHERE
> ROWNUM <= 10";//RETURNS NO RECORDS
> cmd.CommandText = "select * from irdb.GRANTS WHERE ROWNUM
> <= 10";//WORKS GREAT
>
> cmd.CommandType = CommandType.Text;
> OracleDataAdapter da = new OracleDataAdapter(cmd);
> DataTable dt = new DataTable();
> da.Fill(dt);
> Debug.WriteLine(dt.Rows.Count);
> con.Close();
> return dt;
>
> The "kellya.GEMSDATA" returns no records, it only returns an empty
> datatable with the column names, BUT no datarows. Even though when I
> use oracle TOAD to select records it returns all the records! So I know
> that the data is there, it just won't return the rows.
>
> If it matters, kellya.GEMSDATA is a temp table in oracle that I
> created, and I am logged in as kellya
>
> To reiterate, when .NET/OracleClient issues command "select * from
> kellya.GEMSDATA WHERE ROWNUM <= 10" no rows are returned, but a SqlPlus
> and Toad return rows when that command is issued.
>
>
>
> Please help, this is driving me crazy for too many days now. I have
> tried everything I can think of.
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off