Page 1 of 1

UniDAC + Interbase 6 or 7 + a field named "returning"

Posted: Mon 09 Aug 2010 21:39
by Stamp
Hello all! New member here, hopefully i'll be able to contribute to the community once I get my feet nice and wet with UniDAC. However until then, I need some assistance!

I have a field in an interbase database called "returning" As you can imagine, I am running into problems updating this field for entries using UniDAC. I am using Delphi 7. SQL Explorer, IBExpert, and Delphi 7's interbase DB components all can manipulate this field fine.. its only UniDAC that is erroring out.

Looking through the history, "returning" is now a reserved word, but changing the name of the field is out of the question, too large of an impact. Is there a way to disable the parsing of this keyword? Adding doublequotes around the field doesn't work, since Field Delimiters are not enabled for the dialect of the database, which is 1.

If anyone knows how to disable the parsing of returning, or escape the field name in SQL dialect 1, let me know!

Edit: I have set the Required fields to false and DML Refresh to false in the UniQuery, as per my searching in the internet and forums, still no joy.

Getting this error:

Token unknown "where"

This exact SQL works fine in IBExpert. Help!

Posted: Tue 10 Aug 2010 14:50
by Stamp
A small update:

Setting teh client dialect to 3 or 1 does the same thing. Its obviously thinking that i'm trying to invoke the "returning" keyword. Simply wrapping the field in quotes only makes the result dataset contain the word "returning" in place of the actual value of the field. Thoughts?

**Edit**: SQL is as follows:

Code: Select all

    update logger set
    returning = :RETURNING
    where locator = :LOCATOR
returns the following error when trying to prepare:

Code: Select all

    ---------------------------
    Ww
    ---------------------------
    
    Dynamic SQL Error
    SQL error code = -104
    Token unknown - line 3, char -1
    where.
    ---------------------------
    OK   
    ---------------------------
This occurs even when I set the client SQL dialect to 1 in code:

Code: Select all

    query1.Connection.SpecificOptions.Values['SQLDialect'] := '1';

Posted: Thu 12 Aug 2010 07:33
by Dimon
To solve the problem set the TUniQuery.Options.QuoteNames property to True to quote all field names in autogenerated SQL statements.

Re: UniDAC + Interbase 6 or 7 + a field named "returning"

Posted: Wed 15 Aug 2012 21:09
by Stamp
Unfortunately, our version of interbase doesn't support quoted fields :(

Has there been any progress on this issue since last mentioned?

Re: UniDAC + Interbase 6 or 7 + a field named "returning"

Posted: Fri 17 Aug 2012 07:14
by ZEuS
Since version 3.50 UniDAC has the DisableReturningKeyword global variable that allows to disable parsing of the RETURNING keyword.
To use this feature in UniDAC 3.50 you should add the IBCClassesUni to the project's uses list. Then set the DisableReturningKeyword variable to True before executing a query that contains "RETURNING" as a field name.