Published on InterSystems Developer Community (https://community.intersystems.com)

Home > $$$RESTRICT in Data Connector

Question
Evgenii Ermolaev · 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?

#ObjectScript #SQL #InterSystems IRIS BI (DeepSee)
Product version: Caché 2018.1

Source URL:https://community.intersystems.com/post/restrict-data-connector