Skip to main content

%Library.ForeignTableQuery

Class %Library.ForeignTableQuery Extends %Query [ System = 3 ]

Methods

Func

ClassMethod Func() As %SQL.StatementResult [ CodeMode = generator, ServerOnly = 1 ]

Close

ClassMethod Close(%qHandle As %Binary) As %Status [ PublicList = SQLCODE, ServerOnly = 1 ]

Close the connection assoicated with the foreign data wrapper object %qHandle

Execute

ClassMethod Execute(ByRef %qHandle As %Binary, query As %String = "", parameters As %List = "") As %Status [ CodeMode = objectgenerator, PlaceAfter = GetQuery, ServerOnly = 1 ]

Execute takes optional whereClause and parameters parameters for predicate pushdown. This method creates an object of the relevant foreign data wrapper class (%SQL.FDW.*) and returns it by reference in %qHandle.

Fetch

ClassMethod Fetch(ByRef %qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ CodeMode = objectgenerator, PlaceAfter = Execute, ServerOnly = 1 ]

Fetch the next row of data from the external source.

qHandle is a foreign data wrapper object.

The Fetch method sets Row to be a $List of values corresponding to the columns of the query by passing the row by reference to the Fetch method of the foreign data wrapper. If we are past the end of the data and no row is returned, Row should be set to null string (""). If the non-empty row being returned is the last one, AtEnd is set to 1, indicating that an additional call to Fetch may be avoided.