Delphi2005. E2010 Incompatible types: 'Object' and 'Integer' when assigning integer constant to a OracleParameter.Value

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Guest

Delphi2005. E2010 Incompatible types: 'Object' and 'Integer' when assigning integer constant to a OracleParameter.Value

Post by Guest » Thu 09 Jun 2005 05:07

I have following code in Delphi 2005.

Code: Select all

unit dDocumentMain;
interface
uses
	Borland.Vcl.SysUtils, Borland.Vcl.Classes, System.Data, System.ComponentModel,
	Borland.Vcl.Db, cExtprocTesterClasses, Contnrs, Variants, CoreLab.Common,
	CoreLab.Oracle, Borland.Vcl.Math;
[...]
type
[...]
TDocumentMain = class(TDataModule)
[...]
procedure TestProcedure(const P:OracleCommand; out Result:String);
[...]
end;
[...]
implementation
[...]
procedure TDocumentMain.TestProcedure(const P: OracleCommand;
	out Result: String);
resourcestring
	pnOperation='OPERATION';
[...]
var
	opCurrent:OracleParameter;
	I:Integer;
begin
	[...]
	try
		for I:=0 to P.Parameters.Count-1 do
			begin
				opCurrent:=P.Parameters[I];
				if SameText(opCurrent.ParameterName,pnOperation) then
					begin
						opCurrent.Value:=-1;
						Continue;
					end;
[...]
When i compile this code i receive following error:
[Error] dDocumentMain.pas(311): E2010 Incompatible types: 'Object' and 'Integer' on the line "opCurrent.Value:=-1;"

I'm just started to do .NET programming so i cannot understand what is wrong? Why Value declared as "Object" instead of "Variant" or something like this? How can i set parameter of certain type, if this parameter already in the Parameters collection?

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 13 Jun 2005 12:40

Code: Select all

opCurrent.Value:=TObject(-1);

ender
Posts: 14
Joined: Mon 06 Jun 2005 11:32

Post by ender » Tue 14 Jun 2005 05:35

But this is not comfortable to cast each assigned value to TObject. :(

Oleg
Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Post by Oleg » Thu 16 Jun 2005 07:42

We don't have such problem with Delphi 2005 Update Pack 2.
Try to install Update Pack 2 for Delphi 2005.

ender
Posts: 14
Joined: Mon 06 Jun 2005 11:32

Post by ender » Thu 16 Jun 2005 07:46

It is installed. I'm noticed that you have examples as WinForms applications, but i'm use OraDirect.NET in VCL.NET apps.

Oleg
Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Post by Oleg » Thu 16 Jun 2005 08:00

Obviously you have described a problem of Delphi 2005 compiler.
We have a product for VCL - ODAC. It works with VCL.NET as well.

Post Reply