Forum Discussion
Conversion of type to List in database
- 6 years ago
Hi Anonymous
the Schema is a column in a table and you'd select it like so:
AdventureWorks2008R2{[Schema="HumanResources",Item="vEmployee"]}
attaching the [Data]-column like you did above will return the Data-values in list form.
So if you're using a parameter for the schema name called "MySchemaParameter", then the syntax would look as follows:
AdventureWorks2008R2{[Schema=MySchemaParameter,Item="vEmployee"]}[Data]
- 6 years ago
- make sure you turn on HierachySQL data selector. Highlighted is Navigate using full Hierachy
- Do your query with one schema, then edit where the schema is with your Schema variable (don't include the quotes)
- Anonymous6 years ago
Thank you - Both of your suggestions we needed to complete the picture, so let me explain.
When I tried your solution, the Schema=Variable came back and said it could not resolve. There was no "column" for Schema.
Then I tried the next solution, which was exactly what I tried before but as before, it confused the variable with the structure.
Then I realized you both had a point. I always use the option to use the full heirarchy.
However when you do that, it eliminates Schema as a column ! So the filter did not work. When I redid the query WITHOUT the full heirarchy, it is a column and is now selectable using the option. Thank you. So your answer was right as long as you dont select by full heirarchy.
Thank you both
Hi Anonymous
the Schema is a column in a table and you'd select it like so:
AdventureWorks2008R2{[Schema="HumanResources",Item="vEmployee"]}
attaching the [Data]-column like you did above will return the Data-values in list form.
So if you're using a parameter for the schema name called "MySchemaParameter", then the syntax would look as follows:
AdventureWorks2008R2{[Schema=MySchemaParameter,Item="vEmployee"]}[Data]
- Anonymous6 years agoNot applicable
Thank you - Both of your suggestions we needed to complete the picture, so let me explain.
When I tried your solution, the Schema=Variable came back and said it could not resolve. There was no "column" for Schema.
Then I tried the next solution, which was exactly what I tried before but as before, it confused the variable with the structure.
Then I realized you both had a point. I always use the option to use the full heirarchy.
However when you do that, it eliminates Schema as a column ! So the filter did not work. When I redid the query WITHOUT the full heirarchy, it is a column and is now selectable using the option. Thank you. So your answer was right as long as you dont select by full heirarchy.
Thank you both