This is a migrated thread and some comments may be shown as answers.

Parameter order is incorrect when calling Oracle stored procedures

1 Answer 290 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Greg
Top achievements
Rank 1
Greg asked on 22 Jun 2012, 09:39 AM
When mapping a stored procedure OA reorders the parameters of the procedure and uses this order to configure the store command when executing the procedure. This is a problem with providers that bind parameters by position by default, e.g. Oracle.DataAccess. This is a very dangerous, hard to detect silent bug, I only hit it because OA switched two of my parameters that were of different type (varchar2 and date) thus execution failed with an obscure exception (ORA-01841). If the switched parameters are of the same type then the only symptom is bad data returned from the proc.

I can think of two possible fixes here (either should fix the problem but I think both should be implemented)

1. Keep parameters in db order. As requested here: http://www.telerik.com/community/forums/orm/general-discussions/stored-procedures-in-orm-parameters-moving-around.aspx

2. If I see it correctly OA uses the ODP.NET package provided by Oracle (I'm using 4.112.3.0). Set the OracleCommand.BindByName property to true when setting up the store command to force binding parameters by name.

This issue is tested with OA version 2012.2.607.1

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 26 Jun 2012, 12:13 PM
Hello Greg,

 You are correct and this was indeed a bug on our side. As I have written in the other thread the bug is now resolved and the fix will be available with the next service pack.

Kind regards,
Petar
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
Databases and Data Types
Asked by
Greg
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or