tSQLErrorArray - The Database Update Framework

See Also: Declaring Variables, Struct 

Purpose

tSqlErrorArray is a structured type used for some members of the cDbUpdateFunctionLibrary class. Internal usage. Used by the SQLShowErrorList message to show all errors generated after a database update has taken place.

 

Type Declaration

Struct tSQLErrorArray

    String[]  sSqlErrorArray

    Integer[] iSqlErrorArray

End_Struct

 

Struct Members

sSQLErrorArray

Sting error messages.

iSQLErrorArray

Integer error messages.

 

Syntax

Use cDbUpdateFunctionLibrary.pkg

:

tSQLErrorArray {variableName}

 

Declaring variables

To declare tSqlErrorArray variables, use the name of the type (tSqlErrorArray) followed by the variable name.

tSQLErrorArray SQLErrorArray

See struct variables for more details of instantiating struct types.


Example


Procedure SQLShowErrorList

    tSQLErrorArray aSqlErrorArray

    Integer iRows iCount iCh iErrorNum

    String sPath sFileName sErrorTxt

       

    Get psHome of (phoWorkspace(ghoApplication)) to sPath

    Get vFolderFormat sPath to sPath

    Move "SQLErrorLog.txt"  to sFileName

    Get Seq_Open_Output_Channel (sPath + sFileName) to iCh

        Get paSqlErrorArray to aSqlErrorArray

        Move (SizeOfArray(aSqlErrorArray.sSqlErrorArray)) to iRows

        Decrement iRows

        For iCount from 0 to iRows

            Move aSqlErrorArray.sSqlErrorArray[iCount] to sErrorTxt

            Move aSqlErrorArray.iSqlErrorArray[iCount] to iErrorNum

            Writeln channel iCh "Error No: " iErrorNum " Error Text: " sErrorTxt

        Loop

    Send Seq_Close_Channel iCh

       

    Runprogram Background "Notepad.exe" (sPath + sFileName)

End_Procedure


This message could be called after a database update has been done to display the error log. Note that this is send automatically by the cDbUpdateHandler class logic, if used.