Re: size of ftInteger
- From: "Keith G Hicks" <krh@xxxxxxxxxxx>
- Date: Mon, 27 Jun 2005 20:24:09 -0400
I did some more investigating. I did the following:
var
xy:integer;
begin
xy := 999999999;
showmessage(inttostr(sizeof(xy)));
I also tried it for xy:=0
The result is always 4. I had a funny feelling that would be the case. But
now I'm more puzzled. When setting up an integer field in a MS SQL table,
the precision is 10, the scale is 0 and the length is 4. What is the
CreateParameter's "size" parameter looking for. This is a bit confusing. I
went on line and did a google search for "CreateParameter" and "ftInteger"
together. It seems that everyone uses something different almost as if
nobody really knows what to use.
According to the help file:
function CreateParameter(const Name: WideString; DataType: TDataType;
Direction: TParameterDirection; Size: Integer
; Value: OleVariant): TParameter;
In addition, I tried the above test using xy as datatype Single, Double and
Currency. The size came out 4, 8 & 8 respectively. I guess this was no
surprise either because those are the "lengths" as far as MS SQL is
concerned.
Perhaps that parameter should be called "Length" rather than size as this
seems to be a bit misleading. Hopefully someone can clear this up for me.
Keith
.
- References:
- size of ftInteger
- From: Keith G Hicks
- size of ftInteger
- Prev by Date: size of ftInteger
- Next by Date: Re: size of ftInteger
- Previous by thread: size of ftInteger
- Next by thread: Re: size of ftInteger
- Index(es):
Relevant Pages
|