As far as I know in .NET apps connecting with ODP and OLEDB to Oracle, supplies metadata of your queries, like column name, column type. I know this is definitely not the answer you expect on this forum, but you should check your help docs. Issuing an extra select, just for retrieving the name and type of columns is sometimes superfluous.
You have the following options:
- Connection.GetSchema (from 2.0 on)
- OleDbConnection.GetOleDbSchemaTable (in version 1.0, 1.1, 2.0 )
- Use DataAdapter.Fill-t with "select * from ... where 2<1". This will return no rows, but thus you can examine the DataTable Columns collections
For futher details use the online help or goooooogle :-)
Is it true that we can not state a complex query with a WHERE clause and/or JOIN conditions against an Oracle database in VB.Net programs?
No. That would not make sense.
Can you run that query under SQL*PLus and get some output?
How are you executing that query in VB.Net?
Post some sample code of how you do this query in VB.Net and how are you intrepreting the results?
Hi, thanx a lot. I fixed the error already. The program stopped before the execution of that query; but I did not know. Complex queries can be issued :).
Of course, that query was ok under SQL*Plus. The code is very simple as follows.
Dim metaConnection As OleDbConnection = New OleDbConnection(......)
Dim dt As DataSet = New DataSet
Dim insAdapter As OleDbDataAdapter = New OleDbDataAdapter("SELECT m.TableName TableName, m.DBOwner DBOwner, m.ColumnName ColumnName, t.TypeName TypeName, t.ClassNr ClassNr, t.TypeOwner TypeOwner FROM metaTable m, metaType t WHERE m.TypeName = t.TypeName AND m.TableName = '" + insTable.Trim.ToUpper + "' AND m.DBOwner = '" + insSchema.Trim.ToUpper + "'", metaConnection)