Book a Demo

Author Topic: SQL Help  (Read 4411 times)

Maggie

  • EA User
  • **
  • Posts: 106
  • Karma: +0/-0
    • View Profile
SQL Help
« on: March 20, 2015, 09:22:16 pm »
Hello
I am no expert in SQL Queries but find the need to write a SQL Search and would appreciate some help

I want to select all elements within a specified package with type 'Feature'

Here is my first cut
Code: [Select]
SELECT t_object.Name, t_object.Status, t_object.Author FROM t_object WHERE t_object.Object_Type = 'Feature'

But this selects all model elements with type Feature

How can I restrict it to a given package

Thanks

Maggie

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: SQL Help
« Reply #1 on: March 20, 2015, 09:39:04 pm »
Do you mean a SQL search in automation (raw) or one for user searches (cooked)?

a)
Code: [Select]
SELECT t_object.Name, t_object.Status, t_object.Author FROM t_object
WHERE t_object.Object_Type = 'Feature' AND Package_ID = <id>
where you have to supply the relevant package id in <id>

b)
Code: [Select]
SELECT t_object.Name, t_object.Status, t_object.Author FROM t_object
WHERE t_object.Object_Type = 'Feature' AND Package_ID = #Package#

q.


Maggie

  • EA User
  • **
  • Posts: 106
  • Karma: +0/-0
    • View Profile
Re: SQL Help
« Reply #2 on: March 20, 2015, 09:47:43 pm »
Thanks Querty