Delphi 6
Oracle 9.2
dbexpoda.dll v4.20.0.11
--
With TSqlStoredProc (sp) component and stored procedure on Oracle,
when I use the following code, I get no error :
sp.params[0].Value := IntVal; (integer value)
sp.execproc; ---> OK
sp.params[0].AsString := StrVal; (string value)
sp.execproc; ---> OK
But, when I use any of the following codes, I get an "EBcdOverflowException" :
sp.params[0].AsInteger := IntVal; (integer value)
sp.execproc; ---> error
or
Params[0].DataType := ftInteger;
sp.params[0].Value := IntVal;
sp.execproc; ---> error
or
sp.parambyname('xxx').AsInteger := IntVal;
sp.execproc; ---> error
1- why does not it works with AsInteger ?
2- why this same code (i.e.: sp.params[0].AsInteger := IntVal;) works with Interbase and not with Oracle ?
EBcdOverflowException when calling Oracle stored procedure w
-
- Posts: 5
- Joined: Thu 09 Oct 2008 07:48
You should take a look on the DataType property of parameter. Probably it is ftFmtBCD. With the TSQLStoredProc component you cannot change DataType of parameters. When you use the AsInteger property the DataType property is changed to ftInteger. This causes the problem.
So you should use the Value property to save original DataType.
With InterBase the DataType of the parameter is ftInteger initially.
So you should use the Value property to save original DataType.
With InterBase the DataType of the parameter is ftInteger initially.
-
- Posts: 5
- Joined: Thu 09 Oct 2008 07:48
You can set the EnableBCD option for the Oracle driver to False.
Code: Select all
const
coEnableBCD = TSQLConnectionOption(102);
begin
SQLConnection1.Open;
SQLConnection1.SQLConnection.SetOption(coEnableBCD, Integer(False));
end;
-
- Posts: 5
- Joined: Thu 09 Oct 2008 07:48
-
- Posts: 5
- Joined: Thu 09 Oct 2008 07:48
-
- Posts: 5
- Joined: Thu 09 Oct 2008 07:48