Hi, got this error while trying to use UniQuery Params..
Using UniDac v6.0.2 Delphi XE7 Update 1
---------------------------
Debugger Exception Notification
---------------------------
Project PA.exe raised exception class EVariantOverflowError with message 'Overflow while converting variant of type (LongWord) into type (Integer)'.
var
v: variant;
begin
Query.Active := False;
Query.sql.text := 'Select * from Servers where iD = :ID';
V := 3758096384;
Query.ParamByName('ID').Value := V;
Query.Open;
end;
EVariantOverflowError
Re: EVariantOverflowError
Hello,
Please specify the field type and the name of the DB your are working with.
Please specify the field type and the name of the DB your are working with.
Re: EVariantOverflowError
BigInt with Firebird 2.5.3
Re: EVariantOverflowError
Unfortunately, we could not reproduce the issue. Please send a small sample to demonstrate the issue to viktorv*devart*com, including a script to create and fill in the test database object.
Re: EVariantOverflowError
My mistake this only happens on SQL-Server, using 2008R2 the column is declared as:
Code: Select all
CREATE TABLE PA.dbo.SERVERS (
ID BIGINT IDENTITY,
ViktorV wrote:Unfortunately, we could not reproduce...
Re: EVariantOverflowError
We have reproduced the specified error. We will investigate such behavior and inform you about the results.
To solve the problem, set explicitly the parameter data type to ftLargeint. For example:
To solve the problem, set explicitly the parameter data type to ftLargeint. For example:
Code: Select all
var
v: variant;
begin
Query.Active := False;
Query.sql.text := 'Select * from Servers where iD = :ID';
V := 3758096384;
Query.ParamByName('ID').DataType := ftLargeint; // set parameter data type
Query.ParamByName('ID').Value := V;
Query.Open;
end;