Book a Demo

Author Topic: Cannot query Note column in t_object  (Read 4981 times)

hln

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Cannot query Note column in t_object
« on: June 18, 2013, 02:07:10 pm »
I use the following query statements to query Note info in t_object table and it doesn't work:
  • select a.Note as Note from t_object a => error

select Note from t_object => result doesn't contain Note column
select * from t_object => result doesn't contain Note colum
[/list]
It is OK if I alias Note column name as "Notes".
Is it a bug?
« Last Edit: June 18, 2013, 02:38:34 pm by hln »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Cannot query Note column in t_object
« Reply #1 on: June 18, 2013, 02:24:05 pm »
Presumably you are using the Find in Project command? There is a View Notes option on the toolbar (5th button from left) which allows you to show in full, show preview or hide notes.
The Sparx Team
[email protected]

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Cannot query Note column in t_object
« Reply #2 on: June 18, 2013, 02:27:23 pm »
The  Following works fine for the .eap file:
SELECT ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name, Note , object_type as Type, IsLeaf FROM t_object
Where object_type = "Requirement"
order by name
[DOB - see update KP's point above]
« Last Edit: June 18, 2013, 02:30:24 pm by Dermot »

hln

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Cannot query Note column in t_object
« Reply #3 on: June 18, 2013, 02:52:09 pm »
Quote
The  Following works fine for the .eap file:
SELECT ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name, Note , object_type as Type, IsLeaf FROM t_object
Where object_type = "Requirement"
order by name
[DOB - see update KP's point above]
I updated first query statement in my post.
Result from your query doesn't contain Note column (as my second query).

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Cannot query Note column in t_object
« Reply #4 on: June 18, 2013, 08:06:22 pm »
Note might be a reserved word. Try to brace it according to the SQL rules for your RDBMS (in EAP it would be [Notes], others use e.g. 'Notes').

q.
« Last Edit: June 18, 2013, 08:06:43 pm by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Cannot query Note column in t_object
« Reply #5 on: June 19, 2013, 08:18:34 am »
As KP said, the search window is helping you by recognising the Column named 'Note' and putting it in the special notes field. (Which is not shown as a column but a suppressible additional row for each item.)

For the same reason columns named CLASSGUID and CLASSTYPE don't show up in the view at all (but provide context handling/type icon)

You'll also find that the column Object_Type column can show the metatype derived from a stereotype instead of the value actually stored in the database.

It's not a raw view of the db tables, don't expect it to be.
« Last Edit: June 19, 2013, 08:21:38 am by simonm »

hln

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Cannot query Note column in t_object
« Reply #6 on: June 19, 2013, 12:37:47 pm »
Quote
Presumably you are using the Find in Project command? There is a View Notes option on the toolbar (5th button from left) which allows you to show in full, show preview or hide notes.
Thanks KP, but I use these SQL in my add-in code.
Because of private reason, I don't want to alias Note column to another name