Function

Function AEs are called from Scalar or Table SQL Functions.

Data structuer

struct NZAE_HANDLE
The Function Handle. An opaque handle used with Function AE functions.

Functions

void nzaeClose(NZAE_HANDLE handle)
Closes the handle when done.
NzaeRcCode nzaeDone(NZAE_HANDLE handle)
Indicates that the AE is finishing and does not get any more rows or output any more results.
NzaeRcCode nzaeGetEnv(NZAE_HANDLE handle, const char *name, const char **result
Gets an AE or system environment variable. The AE has precedence.
void nzaeGetFirstEnvironmentEntry(NZAE_HANDLE handle, NzaeEnvironmentEntry *entry)
Returns the first environment entry.
NzaeRcCode nzaeGetInputColumn(NZAE_HANDLE handle, int index, NzudsData **data)
Gets input column data. The index is zero-based.
AeUserCode nzaeGetLastErrorCode(NZAE_HANDLE handle)
Gets the code for the last error that occurred.
const char* nzaeGetLastErrorText(NZAE_HANDLE handle)
Get the message text for the last error that occurred.
const char* nzaeGetLibraryFullPath(NZAE_HANDLE h, const char *libraryName, bool caseSens-itive)
Gets the file path for a library name.
NzaeSharedLibraryInfo* nzaeGetLibraryInfo(NZAE_HANDLE h)
Returns NzaeSharedLibraryInfo of the shared library for the request.
NzaeSharedLibraryInfo* nzaeGetLibraryProcessInfo(NZAE_HANDLE h)
Returns NzaeSharedLibraryInfo of the shared library for the process.
NzaeRcCode nzaeGetMetadata(NZAE_HANDLE handle, NzaeMetadata *arg)
Gets metadata about the AE.
NzaeRcCode nzaeGetNext(NZAE_HANDLE handle)
Gets the next input row; returns NZAE_RC_END at End of File.
bool nzaeGetNextEnvironmentEntry(NZAE_HANDLE handle, NzaeEnvironmentEntry *entry)
Returns the next environment entry.
NzaeRcCode nzaeGetNextPartition(NZAE_HANDLE handle)
Gets the next partition; returns NZAE_RC_END at End of Partition.
int nzaeGetNumberOfParameters(NZAE_HANDLE h)
Returns the number of parameters.
const char* nzaeGetParameter(NZAE_HANDLE h, int
Returns a parameter.
NzaeRcCode nzaeGetRuntime(NZAE_HANDLE handle, NzaeRuntime *arg)
Gets runtime information about the AE.
NzaeRcCode nzaeLog(NZAE_HANDLE handle, NzaeLogLevel level, const char *message)
Logs the specified message.
NzaeRcCode nzaeOutputResult(NZAE_HANDLE handle)
Outputs a result row containing the current column values.
NzaeRcCode nzaePing(NZAE_HANDLE handle)
Indicates that the AE is still active and not hanging.
NzaeRcCode nzaeUserError(NZAE_HANDLE handle, const char *_template,...)
Indicates this AE has encountered an error condition.

Enumeration

enum NzaeCorrelationType { NzaeUnknownCorrelationType= 0, NzaeUncorrelated= 1, NzaeInnerCorrelation= 2, NzaeLeftCorrelation= 3 }
Specialized information about how this AE is being invoked.
enum NzaeRcCode { NZAE_RC_ERROR= -1, NZAE_RC_NORMAL= 0, NZAE_RC_END= 1 }
Return codes from nzae functions.

Detailed description

Function AEs are called from Scalar or Table SQL Functions.

Function documentation

void nzaeClose(NZAE_HANDLE handle)
Closes the handle when done.
Parameters:
  • handle

    The function handle.

NzaeRcCode nzaeDone(NZAE_HANDLE handle)
Indicates that the AE is finishing and does not get any more rows or output any more results.
Parameters:
  • handle

    The function handle.

    Returns

    NzaeRcCode

    The function return code.

NzaeRcCode nzaeGetEnv(NZAE_HANDLE handle, const char *name, const char **result)
Indicates that the AE is finishing and does not get any more rows or output any more results.
Parameters:
  • handle

    The function handle.

    Returns

    NzaeRcCode

    The function return code.

void nzaeGetFirstEnvironmentEntry(NZAE_HANDLE handle, NzaeEnvironmentEntry *entry)
Returns the first environment entry.
Parameters:
  • handle

    The function handle.

    Returns

    NzaeEnvironmentEntry entry

    First entry.

This function call is followed by repeated calls to nzaeGetNextEnvironmentEntry. The AE sys-tem owns the memory from this call.

NzaeRcCode nzaeGetInputColumn(NZAE_HANDLE handle, int index, NzudsData **data)
Gets input column data. The index is zero-based.
Parameters:
  • handle

    The function handle.

    index

    The input index.

  • NzudsData data

    The UDS data.

    Returns

    NzaeRcCode

    The function return code.

    NzudsData is defined in nzuds.h. The data belongs to the framework and should not be freed. Called after nzaeGetNext is used to return the next row.

AeUserCode nzaeGetLastErrorCode(NZAE_HANDLE handle)
Gets the code for the last error that occurred.
Parameters:
  • handle

    The function handle.

    Returns

    AeUserCode

    The function error code for the last occurring error.

const char* nzaeGetLastErrorText(NZAE_HANDLE handle)
Get the message text for the last error that occurred.
Parameters:
  • handle

    The function handle.

    Returns

    The message text of the last occurring error.

const char* nzaeGetLibraryFullPath(NZAE_HANDLE h, const char *libraryName, bool caseSensitive)
Gets the file path for a library name.
Parameters:
  • h

    The function handle.

  • libraryName

    The library name.

  • caseSensitive

    If TRUE, the lookup is case-sensitive.

    Returns

    File path if found; NULL otherwise

    Returns NULL if the library is not found. The AE system owns the memory from this call.

NzaeSharedLibraryInfo* nzaeGetLibraryInfo(NZAE_HANDLE h)
Returns NzaeSharedLibraryInfo of the shared library for the request.
Parameters:
  • h

    The function handle.

    Returns

    NzaeSharedLibraryInfo

    The Shared Library information.

    The AE system owns the memory from this call.

NzaeSharedLibraryInfo* nzaeGetLibraryProcessInfo(NZAE_HANDLE h)
Returns NzaeSharedLibraryInfo of the shared library for the process.
Parameters:
  • h

    The function handle.

    Returns

    NzaeSharedLibraryInfo

    The Shared Library information.

    Returns NULL if this is not a Remote AE. The AE system owns the memory from this call.

NzaeRcCode nzaeGetMetadata(NZAE_HANDLE handle, NzaeMetadata *arg)
Gets metadata about the AE.
Parameters:
  • handle

    The function handle.

  • NzaeMetadata arg

    Metadata to be filled out. Created by the caller.

    Returns

    NzaeRcCode

    The function return code.

NzaeRcCode nzaeGetNext(NZAE_HANDLE handle)
Gets the next input row; returns NZAE_RC_END at End of File.
Parameters:
  • handle

    The function handle.

    Returns

    NzaeRcCode

    The function return code.

    Invalidates previous data returned by nzaeGetInputColumn.

bool nzaeGetNextEnvironmentEntry(NZAE_HANDLE handle, NzaeEnvironmentEntry *entry)
Returns the next environment entry.
Parameters:
  • handle

    The function handle.

  • NzaeEnvironmentEntry entry

    The next entry.

    Returns

    FALSE on end.

    The first nzaeGetNextEnvironmentEntry must follow a call to nzaeGetFirstEnvironmentEntry. Returns FALSE on end. Key names may repeat but the current version of a keyname comes last. The AE system owns the memory from this call.

NzaeRcCode nzaeGetNextPartition(NZAE_HANDLE handle)
Gets the next partition; returns NZAE_RC_END at End of Partition.
Parameters:
  • handle

    The function handle.

    Returns

    NzaeRcCode

    The function return code.

    Invalidates previous data retured by nzaeGetInputColumn.

int nzaeGetNumberOfParameters(NZAE_HANDLE h)
Returns the number of parameters.
Parameters:
  • h

    The function handle.

    Returns

    The number of parameters.

const char* nzaeGetParameter(NZAE_HANDLE h, int index)
Returns a parameter.
Parameters:
  • h

    The function handle.

  • index

    The parameter index.

    Returns

    The parameter value.

    The index is zero-based.

NzaeRcCode nzaeGetRuntime(NZAE_HANDLE handle, NzaeRuntime *arg)
Gets runtime information about the AE.
Parameters:
  • handle

    The function handle.

  • NzaeRuntime arg

    Runtime to be filled out. Created by the caller.

    Returns

    NzaeRcCode

    The function return code.

NzaeRcCode nzaeLog(NZAE_HANDLE handle, NzaeLogLevel level, const char *message)
Logs the specified message.
Parameters:
  • handle

    The function handle.

  • NzaeLogLevel level

    The log level.

  • message

    The log message.

    Returns

    NzaeRcCode

    The function return code.

NzaeRcCode nzaeOutputResult(NZAE_HANDLE handle)
Outputs a result row containing the current column values.
Parameters:
  • handle

    The function handle.

    Returns

    NzaeRcCode

    The function return code.

NzaeRcCode nzaePing(NZAE_HANDLE handle)
Indicates that the AE is still active and not hanging.
Parameters:
  • handle

    The function handle.

    Returns

    NzaeRcCode

    The function return code.

NzaeRcCode nzaeUserError(NZAE_HANDLE handle, const char *_template,...)
Indicates this AE has encountered an error condition.
Parameters:
  • handle

    The function handle.

  • _template

    The printf-style template.

    Returns

    NzaeRcCode

    The function return code.

    Implies nzaeDone. Message is built like printf.

Enumeration type documentation

enum NzaeCorrelationType
Specialized information about how this AE is being invoked.

NzaeUnknownCorrelationType

NzaeUncorrelated

NzaeInnerCorrelation

NzaeLeftCorrelation

enum NzaeRcCode
Return codes from nzae functions.

NZAE_RC_ERROR

NZAE_RC_NORMAL

NZAE_RC_END