skip to main content
Interface Provider class : IP methods reference : ipNative
 

ipNative

You must implement this method in your IP if it is to handle the execution of commands that the OpenAccess SDK SQL Engine is unable to parse. This method is called if during the parsing of a SQL command there is a syntax error.
In this case, the OpenAccess SDK SQL Engine calls ipNative in the IP to check if it can handle the parsing. If it returns true, then it is called again to execute the command.
Currently, only commands that do not return rows are supported. ipGetSupport should return true for IP_SUPPORT_NATIVE_COMMAND.
int ipNative(
int64 hstmt,
int iCmdType,
string szCmd,
out long piNumResRows)
 
Table 24: Parameters for ipNative 
Parameter
Type
Description
IN
 
 
hstmt
int64
Statement handle
iCmdType
int
DAM_NC_VALIDATE – validate the passed-in command and return DAM_SUCCESS.
DAM_NC_EXECUTE – execute the native command and return the number of rows affected.
szCmd
string
The command to execute
piNumResRows
long
The number or rows affected.
RETURN
 
 
 
int
DAM_SUCCESS – In DAM_NC_VALIDATE mode, this indicates that the command is supported. In DAM_NC_EXECUTE mode, this indicates that the command was successfully executed.
DAM_FAILURE – Indicates there is a syntax error in the native command. The specific error message should be added using the dam_addError method.
DAM_NOT_AVAILABLE – In DAM_NC_VALIDATE mode, the command issued is not supported.
The ipNative method can call dam_setIP_hstmt to save any context it creates during validation and use dam_getIP_hstmt to retrieve the context when called for DAM_NC_EXECUTE.

See also 

dam_addError
dam_getIP_hstmt
dam_setIP_hstmt
ipGetSupport