2

In our application we are dynamically filling Dropdownlists with Queries returning two columns: Text and Value.

We are now porting this feature to work with Data from an Firebird Database. Using IBExpert to test those queries, I find no way to return a column named "Value" - probably since it's a keyword.

I tried escaping Value with [Value], like in MSSQL, and "Value" or 'Value'. The query won't run. I also tried creating a view with Value as a column, but it wouldn't create the view.

We could change the code to work with different column names, but that would mean we had to change lots of queries.

The query:

SELECT BEZ AS Text, Data2 AS Value FROM SKO120 WHERE Data2 like 'V%'
1
  • 1
    Keywords need to be enclosed with double quotes in (standard) SQL and Firebird complies with that. So as "Value" should work and it does for me. Commented Dec 13, 2013 at 14:50

1 Answer 1

4

If quoting as "Value" doesn't work, then you are using a dialect 1 database (or you have connected with dialect 1). Dialect 1 doesn't support quoted identifiers, it has been deprecated since before Firebird existed (when it was still Interbase 6 beta in 1999/2000).

If this is a new database then restart with a dialect 3 database. If this is an existing database, then you really should consider migrating it to dialect 3. See "Migrating databases to dialect 3" in the Interbase 6 Getting started manual (available from http://www.firebirdsql.org/en/reference-manuals/ it is in the Full Set linked at the end of the page).

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much! That seems to be the problem. Talked to the developer of the original application that uses this database and no, we currently can't change the dialect. I'll have to program my way around this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.