#HASH-OFF

// TEST SETUP
OPTION OICC="^",CICC="^"
VAR sStatus : SHORT
VAR zSql         : STRING
VAR zCode        : STRING
VAR dEffective   : DATE
VAR zString01    : STRING
VAR sql_table    : STRING
VAR lSqlHandle   : LONG
>>^FROM(1,"CODE")^ ^FROM(11,"EFFECTIVE_DATE")^ ^FROM(21,"STRING_01")^


// ACCEPTED FORMATS
// ==================
// - This test needs further refinement.
// - The syntax is intended to connect to a SQL database, execute a query, and fetch results.
sql_table = "SSFPTR"

zSql =  " SELECT TRz_Code, TRd_Effective, TRz_String01"
zSql += " FROM " + sql_table
zSql += " WHERE TRZ_TYPE = 'VS' AND TRz_Deleted <> 'Y'"

sStatus = SQL_CONNECT()
sStatus = SQL_EXEC_DIRECT(lSqlHandle, zSql)
sStatus = SQL_FETCH(lSqlHandle)
DO WHILE sStatus = 0

  // Get the column values for the current row. Note that the column index is 1-based.
  sStatus = SQL_GET_STRING_COL(lSqlHandle, 1, zCode)
  sStatus = SQL_GET_DATE_COL(lSqlHandle, 2, dEffective)
  sStatus = SQL_GET_STRING_COL(lSqlHandle, 3, zString01)

  // Output rows from the SQL query:
  >>^FROM(1,zCode)^ ^FROM(11,dEffective)^ ^FROM(21,zString01)^
  sStatus = SQL_FETCH(lSqlHandle)
ENDDO

sStatus = SQL_DISCONNECT()


// DISCOURAGED FORMATS
// ==================



// REJECTED FORMATS
// ==================
