Book a Demo

Author Topic: SQL Error using t_objectproperties.Value in search  (Read 3250 times)

Martin Kaul

  • EA Novice
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
SQL Error using t_objectproperties.Value in search
« on: September 26, 2020, 12:30:14 am »
Hi,

using following SQL Search in EA:
Code: [Select]
select o.ea_guid as CLASSGUID,o.Object_Type as CLASSTYPE,o.name as Name,o.Object_Type
FROM (t_object o
inner join t_objectproperties op on op.Object_ID = o.Object_ID)
where op.Property = 'Unique-Number'
and op.Value like '<Search Term>'

generates the SQL Error message:
Quote
Microsoft OLE DB Provider for ODBC Drivers [0x80004005]
[ODBC Firebird Driver][Direbird]Dynamic SQL Error
SQL error code = -104
Token unknown - line 5, column 8
Value

It seams the term 'Value' is the problem it is displayed in the Query Builder using blue color like other keywords, for example select, from, inner etc.

How can I specify the t_objectproperties column 'value' in the query.

Best regards
  Martin

Martin Kaul

  • EA Novice
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
Re: SQL Error using t_objectproperties.Value in search
« Reply #1 on: September 26, 2020, 12:37:18 am »
Sorry for self answer - ok maybe others run into the same problem...

The problem was the column name that looks like a SQL keyword. In my example the column name "Value".

The solution is to put the column name into brackets, so the line with the error now looks like:
Code: [Select]
and op.[Value] like '<Search Term>'
best regards
  Martin

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: SQL Error using t_objectproperties.Value in search
« Reply #2 on: September 26, 2020, 04:35:42 am »
Happens everyone any time :-)

q.