FetchSQL

Mon 01 January 2018

Syntax

FetchSQL([SQL.]sqlname[, dbtype[, effdt]] )

Description

Use the FetchSQL function to return the SQL definition with the given sqlname as SQL. sqlname or a string value, matching the dbtype and effdt . If sqlname is a literal name, it must be in quotes.

Parameters

Field or Control

Definition

sqlname

Specify the name of a SQL definition. This is either in the form SQL . sqlname or a string value giving the sqlname.

dbtype

Specify the database type associated with the SQL definition. This parameter takes a string value. If dbtype isn’t specified or is null (""), it is set by default to the current database type (the value returned from the %DbType system variable.)

Values for dbtype are as follows. These values are not case-sensitive:

  • APPSRV

  • DB2ODBC

  • DB2UNIX

  • MICROSFT

  • ORACLE

Note: Database platforms are subject to change.

effdt

Specify the effective date associated with the SQL definition. If effdt isn’t specified, it is set by default to the current as of date, that is, the value returned from the %AsOfDate system variable.

Returns

The SQL statement associated with sqlname as a string.