B
b.pruitt
Hello All,
Can anyone tell why one sql statement works with the data reader but
not the other. To test, I uncomment the string I need.
Dim QueryString As String
***This string does not work
'QueryString = "SELECT * FROM print_server WHERE LS = (SELECT LS FROM
vw_turboinfo WHERE tsn = '080226086')"
***This string does work, and the result returned does exist in
print_server
'QueryString = "SELECT LS FROM vw_turboinfo WHERE tsn = '080226086'"
***This string does work
'QueryString = "SELECT * FROM print_server WHERE LS = 4042390"
Dim Command As New OracleCommand(QueryString, oraCon)
Command.CommandType = CommandType.Text
***I have copied the CommandText into TOAD for Oracle for each of the
3
***strings, and each is valid and returns the correct information.
Debug.Print(Command.CommandText)
Dim reader As OracleDataReader
Try
reader = Command.ExecuteReader
While reader.Read
Debug.Print(reader.Item(1)).ToString
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
End Try
Can anyone tell why one sql statement works with the data reader but
not the other. To test, I uncomment the string I need.
Dim QueryString As String
***This string does not work
'QueryString = "SELECT * FROM print_server WHERE LS = (SELECT LS FROM
vw_turboinfo WHERE tsn = '080226086')"
***This string does work, and the result returned does exist in
print_server
'QueryString = "SELECT LS FROM vw_turboinfo WHERE tsn = '080226086'"
***This string does work
'QueryString = "SELECT * FROM print_server WHERE LS = 4042390"
Dim Command As New OracleCommand(QueryString, oraCon)
Command.CommandType = CommandType.Text
***I have copied the CommandText into TOAD for Oracle for each of the
3
***strings, and each is valid and returns the correct information.
Debug.Print(Command.CommandText)
Dim reader As OracleDataReader
Try
reader = Command.ExecuteReader
While reader.Read
Debug.Print(reader.Item(1)).ToString
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
End Try