Page 1 of 1

Filtering Fielddefs in TVirtualTable?

Posted: Thu 05 Dec 2013 09:37
by Bjarke_Moholt
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?

Re: Filtering Fielddefs in TVirtualTable?

Posted: Thu 05 Dec 2013 10:04
by Bjarke_Moholt
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?

Re: Filtering Fielddefs in TVirtualTable?

Posted: Thu 05 Dec 2013 12:39
by AndreyZ
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.

Re: Filtering Fielddefs in TVirtualTable?

Posted: Thu 05 Dec 2013 14:46
by Bjarke_Moholt
Thank you, I'll look forward to the fix

Re: Filtering Fielddefs in TVirtualTable?

Posted: Thu 05 Dec 2013 15:03
by AndreyZ
If any other questions come up, please contact us.

Re: Filtering Fielddefs in TVirtualTable?

Posted: Mon 06 Jan 2014 11:18
by Bjarke_Moholt
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

Re: Filtering Fielddefs in TVirtualTable?

Posted: Wed 08 Jan 2014 11:07
by ZEuS
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.

Re: Filtering Fielddefs in TVirtualTable?

Posted: Mon 03 Mar 2014 12:16
by Bjarke_Moholt
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.

Re: Filtering Fielddefs in TVirtualTable?

Posted: Wed 05 Mar 2014 08:58
by Bjarke_Moholt
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

Re: Filtering Fielddefs in TVirtualTable?

Posted: Thu 13 Mar 2014 13:51
by PavloP
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.