Filtering Fielddefs in TVirtualTable?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Filtering Fielddefs in TVirtualTable?

Post by Bjarke_Moholt » Thu 05 Dec 2013 09:37

I get an EIBCError exception when using TIBCLoader to load a TVirtualTable to my database:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 2811
POSITION'.


These are the fielddefs I have added to the table:

Code: Select all

    AddFieldDef(IHGGImporter, 'MODEL',      ftFloat);             // index  0 = CMODEL
    AddFieldDef(IHGGImporter, 'POSITION',   ftFloat);             // index  1 = CPOSITION
    AddFieldDef(IHGGImporter, 'LINENO',     ftFloat);             // index  2 = CLINENO
    AddFieldDef(IHGGImporter, 'XUTM',       ftFloat);             // index  3 = CXUTM
    AddFieldDef(IHGGImporter, 'YUTM',       ftFloat);             // index  4 = CYUTM
    AddFieldDef(IHGGImporter, 'ELEVATION',  ftFloat);             // index  5 = CELEVATION
    AddFieldDef(IHGGImporter, 'RESIDDATA',  ftFloat);             // index  6 = CRESIDDATA
    AddFieldDef(IHGGImporter, 'RESIDPAR',   ftFloat);             // index  7 = CRESIDPAR
    AddFieldDef(IHGGImporter, 'RESIDTOTAL', ftFloat);             // index  8 = CRESIDTOTAL
    AddFieldDef(IHGGImporter, 'RESDATGERD', ftFloat);             // index  9 = CRESDATGERD
    AddFieldDef(IHGGImporter, 'NUMLAYERS',  ftFloat);             // index 10 = CNUMLAYERS
I'm betting that it has something to do with POSITION being a reserved word. Is there an easy way to filter the input to TVirtualTable?

Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Re: Filtering Fielddefs in TVirtualTable?

Post by Bjarke_Moholt » Thu 05 Dec 2013 10:04

I've confirmed that the POSITION field is the sinner here - if I use the line

Code: Select all

AddFieldDef(IHGGImporter, '"POSITION"',   ftFloat);             // index  1 = CPOSITION
instead everything runs smoothly. So the question remains, is there functionality to filter inputs to the table?

AndreyZ

Re: Filtering Fielddefs in TVirtualTable?

Post by AndreyZ » Thu 05 Dec 2013 12:39

We added the QuoteNames option to the TIBCLoader component which is intended to avoid such problems. This option will be included in the next IBDAC build.
For the time being, you should use the workaround you already found, quote names when adding them to TVirtualTable.

Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Re: Filtering Fielddefs in TVirtualTable?

Post by Bjarke_Moholt » Thu 05 Dec 2013 14:46

Thank you, I'll look forward to the fix

AndreyZ

Re: Filtering Fielddefs in TVirtualTable?

Post by AndreyZ » Thu 05 Dec 2013 15:03

If any other questions come up, please contact us.

Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Re: Filtering Fielddefs in TVirtualTable?

Post by Bjarke_Moholt » Mon 06 Jan 2014 11:18

AndreyZ wrote:We added the QuoteNames option to the TIBCLoader component which is intended to avoid such problems. This option will be included in the next IBDAC build.
For the time being, you should use the workaround you already found, quote names when adding them to TVirtualTable.
Was this included in the IBDAC 5.2.5? I have trouble finding it

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Filtering Fielddefs in TVirtualTable?

Post by ZEuS » Wed 08 Jan 2014 11:07

Yes, the option was included in the IBDAC 5.2.5. You can either add the following line

Code: Select all

IBCLoader1.Options.QuoteNames := True;
to your code or set the property to True in design-time.

Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Re: Filtering Fielddefs in TVirtualTable?

Post by Bjarke_Moholt » Mon 03 Mar 2014 12:16

Hi again, I'm back to working with IBDAC and have just upgraded my IBDAC to ver. 5.2.6.

I see the option property on TIBCLoader when I try setting QuoteNames at design time, but I get an 'undeclared identifier' error when I try to compile the code you suggested,

Code: Select all

IBCLoader1.Options.QuoteNames := True;
Apparently 'Options' is not an accessible property compile time, which is strange as I have just been able to set the property design time.

Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Re: Filtering Fielddefs in TVirtualTable?

Post by Bjarke_Moholt » Wed 05 Mar 2014 08:58

On additional note, building with the design-time property set up yields the following exception on application.run:
Error reading IBCLoader1.Options.QuoteNames: Property Options.QuoteNames does not exist

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: Filtering Fielddefs in TVirtualTable?

Post by PavloP » Thu 13 Mar 2014 13:51

It seems that there are some old DAC units on your computer. To solve the problem perform the following steps:
- uninstall IBDAC;
- find all DAC units, like CRParser.dcu, CLRClasses.dcu, MemData.dcu, MemDS.dcu, DBAccess.dcu, IBCClasses.dcu files on your PC and delete them;
- find all *dac*.bpl files on your PC and delete them.
- install IBDAC.

Post Reply