Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bigint datatype - Int64

157 views
Skip to first unread message

Fernando G. Filas

unread,
Feb 12, 2003, 7:54:00 AM2/12/03
to
I need help.

I have to store a Int64 Delphi value in a bigint SQL Server field.

In others datatypes I'm using the As<DataType> methods.
Integer (32 bits) = qry.ParamByName('field1').AsInteger := integerValue,
String = qry.ParamByName('field2').AsString := stringValue,
and so...

The question is, which method do I have to use to cast the Int64 value to
bigint??
qry.ParamByName('field3').As???????? := int64Value,

Thans in advance,
FF

Bojidar Alexandrov

unread,
Feb 12, 2003, 8:23:46 AM2/12/03
to

AsCurrency will do the job, or use Value that will return an Variant

--
Bojidar Alexanrov
Kodar Ltd.
http://www.Kodar.net

John Herbster (TeamB)

unread,
Feb 12, 2003, 8:36:05 AM2/12/03
to
"Fernando G. Filas" <ryr...@arnet.com.ar> wrote

> I have to store a Int64 Delphi value in a bigint SQL Server field.
> ...
> The question is, which method do I have to use to cast the Int64 value to
> bigint??
> qry.ParamByName('field3').As???????? := int64Value,

Fernando,
Have you looked at TLargeintField and AsLargeInt?
Regards, JohnH

Fernando G. Filas

unread,
Feb 13, 2003, 7:44:42 AM2/13/03
to
Thanks John, That's right.
Another question: I tryed the AsLargeInt method directly, but it doesn't
work because this method does not exist in the TField class.
So, I had to cast the TField to TLargeintField:

TLargeintField(qry.FieldByName('COD_PEDIDO')).AsLargeInt

Does exist another way to do this?

Thanks again.
FF.

"John Herbster (TeamB)" <herb-sci1_at_sbcglobal.net> wrote in message
news:3e4a4d55$1...@newsgroups.borland.com...

John Herbster (TeamB)

unread,
Feb 13, 2003, 8:54:28 AM2/13/03
to
"Fernando G. Filas" <ryr...@arnet.com.ar> wrote
> ... I tried the AsLargeInt method directly, but it doesn't

> work because this method does not exist in the TField class.
> So, I had to cast the TField to TLargeintField:
> TLargeintField(qry.FieldByName('COD_PEDIDO')).AsLargeInt
> Does exist another way to do this?

Fernando,
Yes. To check that it is really a safe type cast, I would do
(qry.FieldByName('COD_PEDIDO') as TLargeintField).AsLargeInt
This will check the type before casting it.
Rgds, JohnH


0 new messages