0

I am porting REALLY old code to use the UniDAC components. I have hit a wall with a specific UPDATE sql that changes a field named "returning." Simply wrapping the field in quotes does not resolve the issue, because the SQL dialect in the database is 1, which does not support double quote field delimiters. Is there any way around this without changing the field? I am on delphi 7, and am moving away from the interbase db components.

Edit: SQL is as follows:

update logger set
returning = :RETURNING
where locator = :LOCATOR

returns the following error when trying to prepare:

---------------------------
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:

query1.Connection.SpecificOptions.Values['SQLDialect'] := '1';
menjaraz
  • 7,551
  • 4
  • 41
  • 81
Stamp
  • 89
  • 9
  • I don't know Interbase too well, but I know in SQL Server you can put [square brackets] around the field name in a situation like this. Does that work in IB too? – Mason Wheeler Aug 10 '10 at 15:53
  • Where does this error comes from? Does it come from the database, or from the component you are using? – Leonardo Herrera Aug 10 '10 at 19:37
  • My guess that it is coming from the UniDAC query component, since the query works fine in any other tool (Interbase query, SQL Explorer, IBExpert). – Stamp Aug 10 '10 at 19:43
  • In this case I would try to contact the UniDAC developer (but only after carefully searching through the docs) – mjn Aug 10 '10 at 20:35
  • I have contacted developer via email as well as forums. I'll update this thread once a resolution is found! – Stamp Aug 10 '10 at 21:40
  • Turns out that the returning field is a firebird keyword, but not interbase. Regardless, UniDac parses it. After contacting the dev, I had to set a parameter ('ll get it when i go into work tomorrow), and for those SQLs, parameters do not parse correctly. Sigh... – Stamp Nov 19 '10 at 07:12

2 Answers2

1

I had to talk to the developer. It has been addressed to a certain point, but I need to remove all parameters in the query before executing it. Very odd, but its a workaround :/

Stamp
  • 89
  • 9
0

Is it possible for you to create a view leaving everything the same except for this field and use that view in your application?

Is it possible to run this application with the client dll of a Firebird < 2.1 (1.5 for example) and a server with the same version?

I think this is due to the new syntax where returning is a reserved word!

Ritsaert Hornstra
  • 5,013
  • 1
  • 33
  • 51