Hi,
Can OraDirect fill a dataset or datareader with a command similar to DESC EMP or DESCRIBE EMP ?
I'm looking for away to use the native desribe command within an application.
DESC Table
-
- Posts: 25
- Joined: Mon 02 Oct 2006 19:15
DESC Table Statement
Hi,
Thanks for your help. I get the following when trying to run a describe statement ORA-00900: invalid SQL statement.
Below is the sample code I used. Is there special syntax to have a desc statement work?
public void ReadMyData(string myConnString)
{
string mySelectQuery = "DESC EMP";
OracleConnection myConnection = new OracleConnection(myConnString);
OracleCommand myCommand = new OracleCommand(mySelectQuery,myConnection);
myConnection.Open();
try
{
OracleDataReader myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
Console.WriteLine(myReader.GetValue(0));
}
myReader.Close();
}
finally
{
myConnection.Close();
}
}
Thanks for your help. I get the following when trying to run a describe statement ORA-00900: invalid SQL statement.
Below is the sample code I used. Is there special syntax to have a desc statement work?
public void ReadMyData(string myConnString)
{
string mySelectQuery = "DESC EMP";
OracleConnection myConnection = new OracleConnection(myConnString);
OracleCommand myCommand = new OracleCommand(mySelectQuery,myConnection);
myConnection.Open();
try
{
OracleDataReader myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
Console.WriteLine(myReader.GetValue(0));
}
myReader.Close();
}
finally
{
myConnection.Close();
}
}