DBD-SQLAnywhere

 view release on metacpan or  search on metacpan

sacapi.h  view on Meta::CPAN

    /// A pointer to the name of the parameter.
    char *		    	name;
    /// The direction of the parameter.
    a_sqlany_data_direction 	direction;
    /// Information about the bound input value.
    a_sqlany_data_value		input_value;
    /// Information about the bound output value.
    a_sqlany_data_value		output_value;
    
#if _SACAPI_VERSION+0 >= 4
    /// The native type of the column in the database.
    a_sqlany_native_type	native_type;
    /// The precision.
    unsigned short		precision;
    /// The scale.
    unsigned short		scale;
    /// The maximum size a data value in this column can take.
    size_t 			max_size;    
#endif
} a_sqlany_bind_param_info;

/** Returns metadata information about a column value in a result set.
 *
 * sqlany_get_data_info() can be used
 * to populate this structure with information about what was last retrieved by a fetch operation.
 *
 * To view an example of the a_sqlany_data_info structure in use, 
 * see the following sample file in the <dfn>sdk\\dbcapi\\examples</dfn> directory
 * of your SQL Anywhere installation.
 *
 * <ul>
 * <li>send_retrieve_part_blob.cpp
 * </ul>
 * \sa sqlany_get_data_info()
 */
typedef struct a_sqlany_data_info
{
    /// The type of the data in the column.
    a_sqlany_data_type	type;
    /// Indicates whether the last fetched data is NULL.
    /// This field is only valid after a successful fetch operation.
    sacapi_bool		is_null;
    /// The total number of bytes available to be fetched.
    /// This field is only valid after a successful fetch operation.
    size_t 		data_size;
} a_sqlany_data_info;

/** An enumeration of the callback types.
 *
 * The callback types correspond to the embedded SQL callback types.
 * For more information about embedded SQL callbacks, see
 * \salink{db_register_a_callback function, "http://dcx.sybase.com/goto?page=sa160/en/dbprogramming/db-register-a-callback-esql.html", "programming", "db-register-a-callback-esql"}.
 *
 * \hideinitializers
 * \sa sqlany_register_callback()
 */
typedef enum a_sqlany_callback_type {
    /// This function is called just before a database request is sent to the server.
    /// CALLBACK_START is used only on Windows operating systems.
    CALLBACK_START = 0,
    /// This function is called repeatedly by the interface library while the database server or client library is busy processing your database request. 
    CALLBACK_WAIT,
    /// This function is called after the response to a database request has been received by the DBLIB interface DLL.
    /// CALLBACK_FINISH is used only on Windows operating systems. 
    CALLBACK_FINISH,
    /// This function is called when messages are received from the server during the processing of a request.
    /// Messages can be sent to the client application from the database server using the SQL MESSAGE statement.
    /// Messages can also be generated by long running database server statements. 
    CALLBACK_MESSAGE = 7,
    /// This function is called when the database server is about to drop a connection because of a liveness timeout,
    /// through a DROP CONNECTION statement, or because the database server is being shut down.
    /// The connection name conn_name is passed in to allow you to distinguish between connections.
    /// If the connection was not named, it has a value of NULL.
    CALLBACK_CONN_DROPPED,
    /// This function is called once for each debug message and is passed a null-terminated string containing the text of the debug message.
    /// A debug message is a message that is logged to the LogFile file. In order for a debug message to be passed to this callback, the LogFile
    /// connection parameter must be used. The string normally has a newline character (\n) immediately before the terminating null character. 
    CALLBACK_DEBUG_MESSAGE,
    /// This function is called when a file transfer requires validation.
    /// If the client data transfer is being requested during the execution of indirect statements such as from within a stored procedure,
    /// the client library will not allow a transfer unless the client application has registered a validation callback and the response from
    /// the callback indicates that the transfer may take place.
    CALLBACK_VALIDATE_FILE_TRANSFER
} a_sqlany_callback_type;

/** An enumeration of the message types for the MESSAGE callback.
 *
 * For more information about CALLBACK_MESSAGE message types, see
 * \salink{db_register_a_callback function, "http://dcx.sybase.com/goto?page=sa160/en/dbprogramming/db-register-a-callback-esql.html", "programming", "db-register-a-callback-esql"}.
 *
 * \hideinitializers
 * \sa sqlany_register_callback()
 */
typedef enum a_sqlany_message_type {
    /// The message type was INFO.
    MESSAGE_TYPE_INFO = 0,
    /// The message type was WARNING.
    MESSAGE_TYPE_WARNING,
    /// The message type was ACTION.
    MESSAGE_TYPE_ACTION,
    /// The message type was STATUS.
    MESSAGE_TYPE_STATUS,
    /// The message type was PROGRESS.
    /// This type of message is generated by long running database server statements such as BACKUP DATABASE and LOAD TABLE. 
    MESSAGE_TYPE_PROGRESS
} a_sqlany_message_type;

/** Initializes the interface.
 *
 * The following example demonstrates how to initialize the SQL Anywhere C API DLL:
 *
 * <pre>
 * sacapi_u32 api_version;
 * if( sqlany_init( "PHP", SQLANY_API_VERSION_1, &api_version ) ) {
 *     printf( "Interface initialized successfully!\n" );
 * } else {
 *     printf( "Failed to initialize the interface! Supported version=%d\n", api_version );
 * }
 * </pre>
 *
 * \param app_name A string that names the application that is using the API.  For example, "PHP", "PERL", or "RUBY".



( run in 1.571 second using v1.01-cache-2.11-cpan-39bf76dae61 )