Page 1 of 1

Oracle Managed Driver, no varchar Params in Query

Posted: Thu Sep 15, 2016 10:09 am
by rksaskia
Hello,

we use the Oracle.ManagedDataAccess.dll to connect to Oracle.

We define a parameter for sql query, every parameter for varchar fields throws an exception.

Oracle_Param1.png
Oracle_Param1.png (64.56 KiB) Viewed 2339 times
Oracle_Param2.png
Oracle_Param2.png (40.12 KiB) Viewed 2339 times
Oracle_Param3.png
Oracle_Param3.png (15.75 KiB) Viewed 2339 times
bei OracleInternal.ServiceObjects.OracleCommandImpl.VerifyExecution(OracleConnectionImpl connectionImpl, Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
bei OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, Boolean isDescribeOnly, Boolean isFromEF)
bei Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
bei Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
bei System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
bei Stimulsoft.Report.Dictionary.StiSqlSource.RetrieveData(Boolean schemaOnly)
bei Stimulsoft.Report.Dictionary.StiSqlAdapterService.ConnectDataSourceToData(StiDictionary dictionary, StiDataSource dataSource, Boolean loadData)
bei Stimulsoft.Report.Dictionary.StiDataSource.Connect(StiDataCollection datas, Boolean loadData)
bei Stimulsoft.Report.Dictionary.Design.StiDataStoreSourceEditForm.tbRunScript_Click(Object sender, EventArgs e)

You need only a Table with varchar2 fields and used them in the report to reproduce the error.


The same situation at sql server works perfect, what ist wrong with Oracle?

Greetings

Re: Oracle Managed Driver, no varchar Params in Query

Posted: Thu Sep 15, 2016 12:25 pm
by Alex K.
Hello,

For Oracle you should use ":Param" instead "@Param".

Code: Select all

"SELECT * FROM Emp WHERE Job = :pJob"
Thank you.
0001.PNG
0001.PNG (101.11 KiB) Viewed 2337 times
0002.PNG
0002.PNG (99.16 KiB) Viewed 2337 times
0003.PNG
0003.PNG (116.77 KiB) Viewed 2337 times

Re: Oracle Managed Driver, no varchar Params in Query

Posted: Fri Sep 16, 2016 6:07 am
by rksaskia
Hello,

ok, thanks for this solution. Please update your documentation.

Greetings

Re: Oracle Managed Driver, no varchar Params in Query

Posted: Fri Sep 16, 2016 6:30 am
by Alex K.
Hello,

We are always glad to help you!

We will try to update in the near future.

Thank you.