Home All Groups Group Topic Archive Search About

possible bug in oracleclient

Author
10 Apr 2006 8:15 PM
jamesd
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.

Author
10 Apr 2006 8:55 PM
Jeff Dillon
"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


Show quote
"jamesd" <jam***@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.
>

AddThis Social Bookmark Button