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

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Stamp
Posts: 18
Joined: Mon 09 Aug 2010 21:08

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

Post by Stamp » Mon 09 Aug 2010 21:39

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!

Stamp
Posts: 18
Joined: Mon 09 Aug 2010 21:08

Post by Stamp » Tue 10 Aug 2010 14:50

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';

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 12 Aug 2010 07:33

To solve the problem set the TUniQuery.Options.QuoteNames property to True to quote all field names in autogenerated SQL statements.

Stamp
Posts: 18
Joined: Mon 09 Aug 2010 21:08

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

Post by Stamp » Wed 15 Aug 2012 21:09

Unfortunately, our version of interbase doesn't support quoted fields :(

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

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

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

Post by ZEuS » Fri 17 Aug 2012 07:14

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.

Post Reply