Help needed: Advanced Query using Dataconnector

Help needed: Advanced Query using Dataconnector

In an advanced query do I run a query that is built entirely in a text variablethe SQL will only contain the text @SQLstring (expand inline).

This method works well for internal entities, but when I use this for entities that are accessed via a data connector, I get the error:

OutSystems returned the following error:

Advanced GetQuery Error in query: Invalid object name 'Dataconnector.dbo.exTable'

In this sample, @SQLString contains "SELECT * FROM {exTable}", how can I perform this action with the table exTable using Dataconnector"?

Please help!

Matthias Preuter
Hi Matthias,

It seems that there's a problem expanding the table name to the advanced query in runtime. What happens if you explicitely use the correct table name - i.e. instead of

SELECT * FROM {exTable}


SELECT * FROM Dataconnector.insert-the-right-path-for-the-entity

I would assume that
the way to query the table should use the same syntax as if you were querying directly the database. I'm guessing that the right table name is NOT Dataconnector.dbo.exTable .

Can you try to get the right table name, and test the query?

Let us know how it goes.

Paulo Tavares

I´ll try this first thing in the morning! Just to mak sure, did you mean:

Select * from Dataconnector.exDatabase.dbo.exTable

Where Dataconnector is the name of the dataconnector, and exDatabase is the database where the dbo.exTable is stored.
Hi Matthias,

Well, if that's the way that a regular SQL query would access that table, outside of the Agile Platform, then yes, that's what I'm suggesting.

Worst case scenario, what the Advanced Query does is to pass the text to the SQL Server connector, so if you have a query that works directly off of SQL Server, I would expect the exact same query to run in an Advanced Query.

If that does work, I would also suggest sending this to our support, since it seems like it is a bug on our end, when expanding the {exTable} entity.


Paulo Tavares
Thanks for the quick response, I have rewritten the Advanced Query so that only the WHERE clause is offeredas a parameter.

In this way the Agile Platformwill recognize the dataconnector to be used.
Kind regards,
Matthias Preuter