Skip to main content

%SQL.FDW.Abstract

abstract class %SQL.FDW.Abstract extends %Library.RegisteredObject, %SQL.StatementResult

Abstract class providing interface for Foreign Data Wrappers. Foreign Data Wrappers provide the API for interacting with data stored in foreign sources such as CSV files, external databases, distributed file servers etc.

Property Inventory

Method Inventory

Parameters

parameter PASSTHROUGH = 0;
parameter PREDICATEPUSHDOWN = 0;
Specifies whether this foreign data wrapper supports pushing logical predicates to its source. 0 by default, overridden to be 1 by the XDBC FDW

Properties

property %AtEnd as %Boolean;
Whether we are at the end of the entire result set
Property methods: %AtEndDisplayToLogical(), %AtEndGet(), %AtEndIsValid(), %AtEndLogicalToDisplay(), %AtEndNormalize(), %AtEndSet()
property %GetData as %String [ MultiDimensional ];
Multidimensional property that stores the current row being fetched, where each node of the property is indexed by column number and the node data is the field value. This is where the field data is accessed by cached queries and "overrides" the %GetData() method of the %SQL.StatementResult parent class
Property methods: %GetData(), %GetDataDisplayToLogical(), %GetDataGet(), %GetDataIsValid(), %GetDataLogicalToDisplay(), %GetDataLogicalToOdbc(), %GetDataNormalize(), %GetDataSet()
property %ResultSetColumnCount as %Integer;
Property methods: %ResultSetColumnCountDisplayToLogical(), %ResultSetColumnCountGet(), %ResultSetColumnCountIsValid(), %ResultSetColumnCountLogicalToDisplay(), %ResultSetColumnCountNormalize(), %ResultSetColumnCountSet()
property Buffer as %List;
The current buffer (batch of rows - a $lb of $lb's)
Property methods: BufferGet(), BufferIsValid(), BufferLogicalToOdbc(), BufferOdbcToLogical(), BufferSet()
property BufferLength as %Integer;
The size of the buffer (number of characters)
Property methods: BufferLengthDisplayToLogical(), BufferLengthGet(), BufferLengthIsValid(), BufferLengthLogicalToDisplay(), BufferLengthNormalize(), BufferLengthSet()
property BufferPointer as %Integer;
Maintains the pointer output by $listnext
Property methods: BufferPointerDisplayToLogical(), BufferPointerGet(), BufferPointerIsValid(), BufferPointerLogicalToDisplay(), BufferPointerNormalize(), BufferPointerSet()
property RemainingBuffers as %Boolean;
Whether there are more buffers (batches of rows) that the source can return
Property methods: RemainingBuffersDisplayToLogical(), RemainingBuffersGet(), RemainingBuffersIsValid(), RemainingBuffersLogicalToDisplay(), RemainingBuffersNormalize(), RemainingBuffersSet()

Methods

method %Next(ByRef sc As %Library.Status = $$$OK) as %Library.Integer
Advance the result set cursor to the next row. Returns 0 if the cursor is at the end of the result set.. An optional argument contains a %Library.Status value on return. This %Status value indicates success or failure of the %Next call. %SQLCODE is also set by %Next.
method CleanUp(StopLanguageServer As %Boolean) as %Status
Disconnect Gateway, optionally stop External Language Server (costly to start it again).
method Close() as %Status
method Execute(Parameters As %List) as %Status
Execute the query, binding the given parameters first if necessary.
method GetRequestObject(Server As %String, FTClassName As %String) as %Library.DynamicObject
Create the request string sent to Java
method GetSQLMetaData(Output metadata) as %Status
Every foreign data wrapper should build it's own version of this method to return metadata about the columns that will be provided by the foreign data wrapper. Each one should return metadata as specified below. This metadata should be made available as requested after the Prepare() stage of the foreign data wrapper. If desired, a foreign data wrapper can wait until this method is called to retrieve and then build the corresponding metadata structure. see also %SQL.StatementMetadata:%GenerateMetadata() metadata = $lb() 1 - # of SELECT columns 2 - i: 1) Name 2) ODBC Type 3) Precision 4) Scale 5) NULLABLE (integer) 6) Column Label (same as Name) 7) Column Table Name 8) Column Schema Name 9) Column Qualifier Name - NULL 10) $Char(1)/$Char(0) string / $Extract position: 1) isAutoIncrement 2) isCaseSensitive 3) isCurrency 4) IsReadOnly 5) IsRowVersion 6) IsUnique 7) IsAliased 8) IsExpression 9) IsHidden 10) IsIdentity 11) IsKeyColumn 12) IsRowid 13) IsList
method Prepare(Server As %String, FTClassName As %String, Query As %String, Parameters As %List) as %Status
Prepare the Query to be executed against the Server
classmethod QuoteIdentifier(identifier As %String, supportsDelimitedIdentifiers As %Boolean) as %String
Quote identifiers appropriately for the data source type that this foreign data wrapper wraps based on whether delimited identifiers should be supported. Default implementation returns the identifier as is. It is up to the subclass to implement the behavior appropriate for the data source type.
method Reset() as %Status
Reset the result set back to the first row. Note this may entail a full re-execution depending on the specific implmentation of the foreign data wrapper.
method SetSQLCODEFromStatus(sc As %Status, optionalMessage As %String = "")

Inherited Members

Inherited Properties

Inherited Methods

Subclasses

FeedbackOpens in a new tab