質問

Using TestComplete's javascript engine to create a TADOConnection to a remote Oracle 11.2.0.3 server. The query is a simple select with some basic where clauses:

Select * FROM MyUser.MyTable WHERE MyName = 'NAME' AND MyId like '1111%'

When executing the command, it fails and hits an exception with the helpful message of "Unspecified Error"

The odd part to this: Several other selects, deletes, inserts... work just fine using all the same connection logic. The same query even works if I change the * to the column names instead:

Select MyCol1, MyCol2, MyCol3 FROM MyUser.MyTable WHERE MyName = 'NAME' AND MyId like '1111%'

While this is a workaround, the tables have a very large number of Columns and I'd like the * to work as intended. Any ideas what may be causing the query to fail?

Also, running the query from sqlcmd and sqldeveloper both behave and return proper results.

役に立ちましたか?

解決

This means that the table contains one or more fields with data type which is not supported by the OLE DB provider you use. To find out which exactly fields are problematic, you can add fields one by one to the query and check whether it works. Once you found the problematic fields, you will have to list all fields except for these in your Select clause.

Also, if you are using a provider from Microsoft (provider=MSDAORA), try changing it to the Oracle native provider (provider=OraOLEDB.Oracle).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top