|
KDBC
Unified C Database Connectivity — SQLite, PostgreSQL, MariaDB, Oracle, MSSQL
|
Functions | |
| kdbc_stmt * | kdbc_prepare_call (kdbc_conn *conn, const char *sql) |
| Prepare a stored procedure call. | |
| int | kdbc_register_out (kdbc_stmt *stmt, int idx) |
| Register a parameter as OUT. | |
| int | kdbc_call_execute (kdbc_stmt *stmt) |
| Execute a callable statement. | |
| int64_t | kdbc_call_get_long (kdbc_stmt *stmt, int idx) |
| Retrieve an OUT parameter as a 64-bit integer. | |
| const char * | kdbc_call_get_string (kdbc_stmt *stmt, int idx) |
| Retrieve an OUT parameter as a string. | |
Execute stored procedures with IN and OUT parameters.
Uses JDBC-style call syntax: "{CALL proc_name(?, ?)}". The library strips the braces and translates for each database.
Prepare a stored procedure call.
| conn | An open connection. |
| sql | JDBC-style call syntax, e.g. "{CALL my_proc(?, ?)}". |
| int kdbc_register_out | ( | kdbc_stmt * | stmt, |
| int | idx ) |
Register a parameter as OUT.
Must be called before kdbc_call_execute().
| stmt | A callable statement. |
| idx | Parameter index (1-indexed). |
| int kdbc_call_execute | ( | kdbc_stmt * | stmt | ) |
Execute a callable statement.
| stmt | A callable statement with all parameters bound/registered. |
| int64_t kdbc_call_get_long | ( | kdbc_stmt * | stmt, |
| int | idx ) |
Retrieve an OUT parameter as a 64-bit integer.
| stmt | A callable statement after execution. |
| idx | OUT parameter index (1-indexed). |
| const char * kdbc_call_get_string | ( | kdbc_stmt * | stmt, |
| int | idx ) |
Retrieve an OUT parameter as a string.
| stmt | A callable statement after execution. |
| idx | OUT parameter index (1-indexed). |