Home > Back-end >  Who will help me to solve a question about bigint type of assignment?
Who will help me to solve a question about bigint type of assignment?

Time:10-24

Description:
SQL data table of the field type is: the bigint

Delphi statement:
Var JHD_ID: int64;
Value:
JHD_ID:=Adatasource. DataSet. FieldByName (" ID "). The Value;
Assignment:
Method 1:
FieldByName (' JHD_ID '). The value:=JHD_ID;//it can compile, but in a times wrong, run to the
Method 2:
FieldByName (' JHD_ID). AsInteger:=JHD_ID;//it can compile and run, but if the value is greater than JHD_ID int range of data error,

Teachers, please correct method should be? Thank you for the first,

CodePudding user response:

Try ParamByName (' JHD_ID). AsInteger:=JHD_ID;

CodePudding user response:

Or ParamByName (' JHD_ID '). The Value:=JHD_ID;

CodePudding user response:

 
- mssql2000
The CREATE TABLE [dbo] [t1] (
[aa] [bigint] NULL,
(bb) (int) NULL
) ON the (PRIMARY)
GO


 
Var
A: Int64;
The begin
A:=9223372036854775807;//the maximum int64
Qry1. Append;
Qry1. FieldByName (' aa '). The Value:=a;
Qry1. FieldByName (" bb "). The Value:=1234567890;
Qry1. Post;
//D xe run through
end;
  • Related