Parameters for TOraScript ( ODAC Version 9.6.19 ) does not work anymore

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
redhair
Posts: 11
Joined: Thu 20 Jun 2013 08:19

Parameters for TOraScript ( ODAC Version 9.6.19 ) does not work anymore

Post by redhair » Fri 11 Sep 2015 08:52

Hi ODAC Support Team,

while testing the new ODAC version ( 9.6.19 for C++ Builder XE 7 )
the following source doesn't work anymore :

Code: Select all

	OraScript1->Params->Clear();
	OraScript1->SQL->Text = "SELECT * FROM SOE.CUSTOMERS WHERE CUSTOMER_ID = :PARAM1 ;";

	for (int i = 0; i < OraScript1->Statements->Count; i++) {
// here it throws the exception
		OraScript1->Statements->Items[i]->Params->ParamByName("PARAM1")->DataType  = ftInteger;  
		OraScript1->Statements->Items[i]->Params->ParamByName("PARAM1")->AsString  = 2382;
	}
	OraScript1->DataSet = SmartQuery1;
	OraScript1->Execute();
The following error occurs : EDatabaseError "Parameter PARAM1 not found"
In the previous version ( 9.5.18) of ODAC i have no problems with it.

Thanks for any help.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Parameters for TOraScript ( ODAC Version 9.6.19 ) does not work anymore

Post by AlexP » Fri 11 Sep 2015 09:22

Hello,

OraScript doesn't support parameters. The script is executed "as is". If you want to use parametrized scripts, you should use OraSQL.

redhair
Posts: 11
Joined: Thu 20 Jun 2013 08:19

Re: Parameters for TOraScript ( ODAC Version 9.6.19 ) does not work anymore

Post by redhair » Fri 11 Sep 2015 09:38

Hi Alex,

in opposite to the TOraSQL component the TOraScript component has an OnError event.
Do you have any idea, which component i could use instead of the TOraScript component ?

Thank you.

redhair
Posts: 11
Joined: Thu 20 Jun 2013 08:19

Re: Parameters for TOraScript ( ODAC Version 9.6.19 ) does not work anymore

Post by redhair » Fri 11 Sep 2015 11:09

Hi Alex,

Why the TOraScript component has a ScanParams property, when it doesn't support parameters ?
( There is no entry for this property in your help file )

Thank you.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Parameters for TOraScript ( ODAC Version 9.6.19 ) does not work anymore

Post by AlexP » Mon 14 Sep 2015 09:09

Hello,

OraScript has an ability to specify the DataSet through which commands will be executed. In order to avoid parameter check in this DataSet (to increase performance), this variable was added.

Post Reply