Page 1 of 1

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

Posted: Fri 11 Sep 2015 08:52
by redhair
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.

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

Posted: Fri 11 Sep 2015 09:22
by AlexP
Hello,

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

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

Posted: Fri 11 Sep 2015 09:38
by redhair
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.

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

Posted: Fri 11 Sep 2015 11:09
by redhair
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.

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

Posted: Mon 14 Sep 2015 09:09
by AlexP
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.