Recent

Author Topic: ftByte in TFieldType not exist in Lazarus. But exists in Delphi and Zeos  (Read 5000 times)

Fantablup

  • Full Member
  • ***
  • Posts: 169
I had a headache with this.
Some hours doing search on ftbyte in Lazarus for TFieldType.
I ise Zeos an with stByte. And i couldn't update column with TZquery because it did not have ftByte in the parameter TFieldType. And it does not have AsByte in the parameter value.

After some hours i used Value instead of AsByte(not exists) in the parameter value.

Seems to work.


Fantablup

  • Full Member
  • ***
  • Posts: 169
I am totally correct.

Not in my Lazarus instalation.
I'm using version 2.0.12.

Absolutely nothing in the DB unit here. It does not exists here.
Strange.
Const
  Fieldtypenames : Array [TFieldType] of String[15] =
    (
      {ftUnknown} 'Unknown',
      {ftString} 'String',
      {ftSmallint} 'Smallint',
      {ftInteger} 'Integer',
      {ftWord} 'Word',
      {ftBoolean} 'Boolean',
      {ftFloat} 'Float',
      {ftCurrency} 'Currency',
      {ftBCD} 'BCD',
      {ftDate} 'Date',
      {ftTime} 'Time',
      {ftDateTime} 'DateTime',
      {ftBytes} 'Bytes',
      {ftVarBytes} 'VarBytes',
      {ftAutoInc} 'AutoInc',
      {ftBlob} 'Blob',
      {ftMemo} 'Memo',
      {ftGraphic} 'Graphic',
      {ftFmtMemo} 'FmtMemo',
      {ftParadoxOle} 'ParadoxOle',
      {ftDBaseOle} 'DBaseOle',
      {ftTypedBinary} 'TypedBinary',
      {ftCursor} 'Cursor',
      {ftFixedChar} 'FixedChar',
      {ftWideString} 'WideString',
      {ftLargeint} 'Largeint',
      {ftADT} 'ADT',
      {ftArray} 'Array',
      {ftReference} 'Reference',
      {ftDataSet} 'DataSet',
      {ftOraBlob} 'OraBlob',
      {ftOraClob} 'OraClob',
      {ftVariant} 'Variant',
      {ftInterface} 'Interface',
      {ftIDispatch} 'IDispatch',
      {ftGuid} 'Guid',
      {ftTimeStamp} 'TimeStamp',
      {ftFMTBcd} 'FMTBcd',
      {ftFixedWideChar} 'FixedWideChar',
      {ftWideMemo} 'WideMemo'
    );   

But it works with setting unknown and value on the parameter value.
« Last Edit: July 03, 2021, 08:50:50 pm by Fantablup »

Fantablup

  • Full Member
  • ***
  • Posts: 169
Ahaaaa..

My Lazarus is using FPC 3.2.0.
Latest is 3.2.2

Maybe a update is smart?

 :)

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Yes, last FPC added them:

ftOraTimeStamp, ftOraInterval, ftLongWord, ftShortint, ftByte, ftExtended);

marsupilami79

  • New Member
  • *
  • Posts: 32
Hello Fantablup,

I had a headache with this.
Some hours doing search on ftbyte in Lazarus for TFieldType.
I ise Zeos an with stByte. And i couldn't update column with TZquery because it did not have ftByte in the parameter TFieldType. And it does not have AsByte in the parameter value.

After some hours i used Value instead of AsByte(not exists) in the parameter value.

Seems to work.

You might want to check if this is supported in Zeos 8.0. We added our own fields there. So we probably support ftByte there too.
Zeos developer

LacaK

  • Hero Member
  • *****
  • Posts: 691
Can I ask if you want use/access:
- database field which is of type "byte"?
- or access parameter in SQL using TParam.AsByte ? (there exists AsByte property in Delphi)
- or access field value TField.AsByte ? (there is no AsByte property in Delphi)

Note: I added TParam.AsByte property for Delphi compatibility (however this will be only part of incomming FPC 3.4 I guess)
« Last Edit: July 12, 2021, 02:23:57 pm by LacaK »

Fantablup

  • Full Member
  • ***
  • Posts: 169
Ohh..

AsByte is not in Lazarus either.

Yes, as byte.

I will use metadata of the DBCresultset instead for getting the field types.

Thanks for the update.
« Last Edit: July 12, 2021, 02:40:11 pm by Fantablup »

LacaK

  • Hero Member
  • *****
  • Posts: 691
AsByte is not in Lazarus either.

Lazarus 2.0.12 is build with FPC 3.2.0
upcomming Lazarus 2.2.0 will be build with FPC 3.2.2

My change is in FPC TRUNK only, so if you use only stable version of Lazarus then you must wait for Lazarus which will be build with FPC 3.4.0
(it can take 1-2 years ... until new major FPC will be released)

Fantablup

  • Full Member
  • ***
  • Posts: 169
I saw that.

So i will not use the Lazarus field types. But instead the st**** field types in Zeos. Getting it with the metadata and the columns types there.

 

TinyPortal © 2005-2018