Unable to use SQL query for filtering

4 posts / 0 new
Last post
Offline
Last seen: 4 years 10 months ago
Joined: 09/21/2015
Posts: 2
Unable to use SQL query for filtering

Hi

I've been working on filters for quite some time now. I'm able to use contentFilters, queryFilters with conditions to filter.

But I'm not able to get through if complete SQL query (Select command) is used. Can anybody just give some simple example of selecting some fields from a topic on the basis of some condition.

Thanks in advance

Keywords:
Gerardo Pardo's picture
Offline
Last seen: 3 weeks 4 days ago
Joined: 06/02/2010
Posts: 592

I am not sure what you mean by "selecting some fields". The filter selects samples based on the value of certain fields but it gest the complete sample. Not a subset of the fields.  So if you have samples that contain many fiels among which there is a field called "x" then the expression  "x < 5" will select all the samples that satisfy that condition. There is no way to specify a subset of the fields. There is an example here: https://community.rti.com/examples/deadlines-and-content-filtering

Is that what you meant? If not, can you explain further the use-case?

Gerardo

rip
rip's picture
Offline
Last seen: 1 hour 59 min ago
Joined: 04/06/2012
Posts: 322

I think he (she) is trying to use a select clause (select (fields) from (topic.samples) where [condition]).  The use of "complete" in his statement implies that he thinks that the SQL-like is SQL-in-actuality.

Techie -- it isn't.  It is only the where clause, and it isn't a 'true' SQL engine.  It's just a parser that follows parts of the SQL syntax.  And, as Gerardo said, it only works at the level of the "row", not at the level of the "fields" in the "table" (all in quotes, because those are the RDBMS equivalents to a DDS sample, field and topic/instance:  It only works at the level of the sample, not at the level of the fields in the instance).

But DDS isn't an RDBMS, so they are in quotes. 

Offline
Last seen: 4 years 10 months ago
Joined: 09/21/2015
Posts: 2

@rip: Great!! That is exactly what I asked.

But RTI Connect Core Libraries and Utilities User's Manual (version 5.0 of total pages 780) at page no 184 or 5-17 or section no 5.4.6.1 says that it is possible. That is the reason that I was exploring the possiblity of selecting specific Fields from the given(filtered) Instances of the topic. My query is, why is it written in the document if it is not supported.