Book a Demo

Author Topic: What is wrong with this SQL query?  (Read 4019 times)

jplusip

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
What is wrong with this SQL query?
« on: September 23, 2015, 11:48:13 am »
I'm trying to write a SQL query that will do the following:

Considering a signal with properties (parts in this case, as it's SysML), some of which have properties of their own as embedded elements, I want to output a table such as:


FieldDescriptionData TypeUnit

Where the Field will be the name of the property, the Description should be the name(s) of the children properties of that property, the Data Type should be the Type of the subproperty,  and the Unit should be the stereotype of the subproperty (since I don't know how to grab the "unit" defined in the value types that I'm using).

The SQL is as follows:
select s.Name as Signal, f.Name as Field, p.Name as Description, p.Type as DataType, p.Stereotype as Unit
from t_object as s, t_object as f, t_object as p
where f.ParentID = s.Object_ID and p.ParentID = f.Object_ID
order by s.Name, f.Name, p.Name, p.Type, p.Stereotype

And during document generation I get an error DAO.Database[3061] Too few parameters. Expected 1, and the resulting document is... blank.

Any ideas on what I'm doing wrong here?

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: What is wrong with this SQL query?
« Reply #1 on: September 23, 2015, 11:54:08 am »
p.Type doesn't exist. Should that be p.Object_Type?
« Last Edit: September 23, 2015, 11:57:57 am by AaronB »

jplusip

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: What is wrong with this SQL query?
« Reply #2 on: September 23, 2015, 02:11:50 pm »
Quote
p.Type doesn't exist. Should that be p.Object_Type?

You sir, are a gentleman and a scholar. That fixed the issue completely. Thank you.