Question
· Feb 2, 2021

$$$RESTRICT in Data Connector

Following instructions on this page https://docs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=D2IMP_... I am trying to create a Data Connector to be used as a base class for a cube with update support.
That page suggests that putting an SQL query inside XData block is not suitable for a Data Connector that supports updates.
Later it also suggests that to enable updates your SQL query must include 

WHERE $$$RESTRICT

Providing an example of it in XData block example like this

<sql>SELECT A,B,C FROM MyApp.MyTable WHERE $$$RESTRICT</sql>

Which I already have a problem with, because earlier in that section it said You cannot use this technique (regarding defining an SQL query inside XData block) if the data connector must support detail listings or updates. In such cases, instead see “Defining the Query at Runtime,” later in this chapter.

However, the real problem for me is the use of $$$RESTRICT within string literal of an SQL query used for OnGetSourceResultSet. What would be a proper syntax here?

Product version: Caché 2018.1
Discussion (2)1
Log in or sign up to continue

Hi Evgenii,

I noticed this question has not been answered yet, is there a specific reason why you are looking into using a Data Connector? Typically before recommending a Data Connector, we would recommend that a new class is created and populated from a similar query that your Data Connector would have used. This allows for a lot more standard cube usage. Standard options like synchronization and detail listings would be available without needing to implement custom code to modify the SQL and they wouldn't require you to worry about using $$$RESTRICT

Well, a Data Connector seemed like the most logical solution. Just put the query into the data connector class, but the documentation got the best of me and I failed.

Defining a new class seems like much more work, since I'd need to manually repopulate the table or set it as a task.

So far I am getting by by simply rendering the data within a CSP application and might not pursue the use of DeepSee anymore.