Domanda

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%'
È stato utile?

Soluzione

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).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top