Book a Demo

Author Topic: Class notes in database  (Read 5959 times)

novikovigor

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Class notes in database
« on: July 10, 2013, 04:34:08 pm »
Hello!
How can i find by SQL field "Notes" for class and associate it with this class?
I can find it for attribute (t_attribute.notes), tagged value (t_attributetag.notes), but i can't find for class.

I use model search in EA to create SQL queries.
« Last Edit: July 10, 2013, 04:36:35 pm by novikovigor »

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Class notes in database
« Reply #1 on: July 10, 2013, 04:52:19 pm »
Notes for elements such as Classes are stored in t_object.Note.

If the notes do not appear in the search results, you may need to enable display of Notes in the Model Search Toolbar.

Otherwise, maybe try using an alias on the Note column.  For example:

SELECT ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name, Note AS ElementNote from t_object

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Class notes in database
« Reply #2 on: July 10, 2013, 04:54:44 pm »
Hello,

select Name, Note from t_object
where object_type = 'Class' AND
           Name         like 'N#WC#'
order by Name

Just an example. SQL gives you a lot of power. If you want something different just ask.

Kind regards,

Helmut

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

novikovigor

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: Class notes in database
« Reply #3 on: July 10, 2013, 05:03:27 pm »
Aaron B, Helmut Ortmann, thanks a lot!
I thought usages of getting notes for objects, attributes and tagged values are similarly, and for objects I used "notes" instead of "note"!

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Class notes in database
« Reply #4 on: July 10, 2013, 05:25:15 pm »
Hello,

to easily find the column names use the query:

Select * from t_object

Another option is the eBook from Thomas Kilian InsideEA.

Best regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

novikovigor

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: Class notes in database
« Reply #5 on: July 10, 2013, 05:36:22 pm »
Helmut Ortmann, I know. I use SQL every day and "select *" was the first query that I create to define all columns in t_object and others tables. But "note" column is hidden in result set however it exists!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Class notes in database
« Reply #6 on: July 10, 2013, 07:24:40 pm »
The inline SQL editor obviously mangles the query before passing it to the database. The only way seems to be to write a script.

I also tried
Code: [Select]
SELECT [notes] as nbut that returned an error.

q.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Class notes in database
« Reply #7 on: July 11, 2013, 10:27:09 am »
As I said earlier, make sure that Notes are enabled on the Model Search Toolbar (i.e. set to either Notes Preview or Full Notes).  The search window seems to detect the default "Note" field and shows it as a special notes section rather than a normal column.

You can bypass this handling and just show it in a normal column by giving the notes column an alias (E.g. t_object.Note AS ElementNote)