sqlanywhere 0.1.0-i486-linux → 0.1.1-i486-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +10 -1
- data/README +5 -1
- data/Rakefile +202 -0
- data/ext/Makefile +149 -0
- data/ext/extconf.rb +30 -0
- data/ext/sacapi.h +679 -0
- data/ext/sacapidll.c +162 -0
- data/ext/sacapidll.h +253 -0
- data/ext/sacapidll.o +0 -0
- data/ext/sqlanywhere.c +200 -176
- data/ext/sqlanywhere.o +0 -0
- data/ext/sqlanywhere.so +0 -0
- data/lib/sqlanywhere.so +0 -0
- data/test/sqlanywhere_test.rb +1 -0
- metadata +14 -5
data/ext/sacapidll.c
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
//====================================================
|
2
|
+
//
|
3
|
+
// Copyright 2008 iAnywhere Solutions, Inc.
|
4
|
+
//
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
// you may not use this file except in compliance with the License.
|
7
|
+
// You may obtain a copy of the License at
|
8
|
+
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
//
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
//
|
15
|
+
// See the License for the specific language governing permissions and
|
16
|
+
// limitations under the License.
|
17
|
+
//
|
18
|
+
// While not a requirement of the license, if you do modify this file, we
|
19
|
+
// would appreciate hearing about it. Please email
|
20
|
+
// sqlany_interfaces@sybase.com
|
21
|
+
//
|
22
|
+
//====================================================
|
23
|
+
#include <string.h>
|
24
|
+
#include <stdlib.h>
|
25
|
+
#include <stdio.h>
|
26
|
+
|
27
|
+
#if defined( _WIN32 )
|
28
|
+
#include <windows.h>
|
29
|
+
#define DEFAULT_LIBRARY_NAME "dbcapi.dll"
|
30
|
+
#else
|
31
|
+
#include <dlfcn.h>
|
32
|
+
/* assume we are running on a UNIX platform */
|
33
|
+
#if defined( _REENTRANT ) || defined( _THREAD_SAFE ) \
|
34
|
+
|| defined( __USE_REENTRANT )
|
35
|
+
/* if building a thread-safe library, we need to load
|
36
|
+
the thread-safe dbcapi library */
|
37
|
+
#define DEFAULT_LIBRARY_NAME "libdbcapi_r.so"
|
38
|
+
#else
|
39
|
+
#define DEFAULT_LIBRARY_NAME "libdbcapi.so"
|
40
|
+
#endif
|
41
|
+
#endif
|
42
|
+
|
43
|
+
#include "sacapidll.h"
|
44
|
+
|
45
|
+
static
|
46
|
+
void * loadLibrary( const char * name )
|
47
|
+
/*************************************/
|
48
|
+
{
|
49
|
+
void * handle;
|
50
|
+
#if defined( _WIN32 )
|
51
|
+
handle = LoadLibrary( name );
|
52
|
+
#else
|
53
|
+
handle = dlopen( name, RTLD_LAZY );
|
54
|
+
#endif
|
55
|
+
return handle;
|
56
|
+
}
|
57
|
+
|
58
|
+
static
|
59
|
+
void unloadLibrary( void * handle )
|
60
|
+
/**********************************/
|
61
|
+
{
|
62
|
+
#if defined( _WIN32 )
|
63
|
+
FreeLibrary( handle );
|
64
|
+
#else
|
65
|
+
dlclose( handle );
|
66
|
+
#endif
|
67
|
+
}
|
68
|
+
|
69
|
+
static
|
70
|
+
void * findSymbol( void * dll_handle, char * name )
|
71
|
+
/**************************************************/
|
72
|
+
{
|
73
|
+
#if defined( _WIN32 )
|
74
|
+
return GetProcAddress( dll_handle, name );
|
75
|
+
#else
|
76
|
+
return dlsym( dll_handle, name );
|
77
|
+
#endif
|
78
|
+
}
|
79
|
+
|
80
|
+
#define LookupSymbolAndCheck( api, sym ) \
|
81
|
+
api->sym = (sym ## _func)findSymbol( api->dll_handle, #sym ); \
|
82
|
+
if( api->sym == NULL ) { \
|
83
|
+
unloadLibrary( api->dll_handle ); \
|
84
|
+
return 0; \
|
85
|
+
}
|
86
|
+
|
87
|
+
int sqlany_initialize_interface( SQLAnywhereInterface * api, const char * path )
|
88
|
+
/*******************************************************************************/
|
89
|
+
{
|
90
|
+
char * env;
|
91
|
+
memset( api, 0, sizeof(*api));
|
92
|
+
|
93
|
+
if( path != NULL ) {
|
94
|
+
api->dll_handle = loadLibrary( path );
|
95
|
+
if( api->dll_handle != NULL ) {
|
96
|
+
goto loaded;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
env = getenv( "SQLANY_API_DLL" );
|
100
|
+
if( env != NULL ) {
|
101
|
+
api->dll_handle = loadLibrary( env );
|
102
|
+
if( api->dll_handle != NULL ) {
|
103
|
+
goto loaded;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
api->dll_handle = loadLibrary( DEFAULT_LIBRARY_NAME );
|
107
|
+
if( api->dll_handle != NULL ) {
|
108
|
+
goto loaded;
|
109
|
+
}
|
110
|
+
return 0;
|
111
|
+
|
112
|
+
loaded:
|
113
|
+
LookupSymbolAndCheck( api, sqlany_init );
|
114
|
+
LookupSymbolAndCheck( api, sqlany_fini );
|
115
|
+
LookupSymbolAndCheck( api, sqlany_new_connection );
|
116
|
+
LookupSymbolAndCheck( api, sqlany_free_connection );
|
117
|
+
LookupSymbolAndCheck( api, sqlany_make_connection );
|
118
|
+
LookupSymbolAndCheck( api, sqlany_connect );
|
119
|
+
LookupSymbolAndCheck( api, sqlany_disconnect );
|
120
|
+
LookupSymbolAndCheck( api, sqlany_execute_immediate );
|
121
|
+
LookupSymbolAndCheck( api, sqlany_prepare );
|
122
|
+
LookupSymbolAndCheck( api, sqlany_free_stmt );
|
123
|
+
LookupSymbolAndCheck( api, sqlany_num_params );
|
124
|
+
LookupSymbolAndCheck( api, sqlany_describe_bind_param );
|
125
|
+
LookupSymbolAndCheck( api, sqlany_bind_param );
|
126
|
+
LookupSymbolAndCheck( api, sqlany_send_param_data );
|
127
|
+
LookupSymbolAndCheck( api, sqlany_reset );
|
128
|
+
LookupSymbolAndCheck( api, sqlany_get_bind_param_info );
|
129
|
+
LookupSymbolAndCheck( api, sqlany_execute );
|
130
|
+
LookupSymbolAndCheck( api, sqlany_execute_direct );
|
131
|
+
LookupSymbolAndCheck( api, sqlany_fetch_absolute );
|
132
|
+
LookupSymbolAndCheck( api, sqlany_fetch_next );
|
133
|
+
LookupSymbolAndCheck( api, sqlany_get_next_result );
|
134
|
+
LookupSymbolAndCheck( api, sqlany_affected_rows );
|
135
|
+
LookupSymbolAndCheck( api, sqlany_num_cols );
|
136
|
+
LookupSymbolAndCheck( api, sqlany_num_rows );
|
137
|
+
LookupSymbolAndCheck( api, sqlany_get_column );
|
138
|
+
LookupSymbolAndCheck( api, sqlany_get_data );
|
139
|
+
LookupSymbolAndCheck( api, sqlany_get_data_info );
|
140
|
+
LookupSymbolAndCheck( api, sqlany_get_column_info );
|
141
|
+
LookupSymbolAndCheck( api, sqlany_commit );
|
142
|
+
LookupSymbolAndCheck( api, sqlany_rollback );
|
143
|
+
LookupSymbolAndCheck( api, sqlany_client_version );
|
144
|
+
LookupSymbolAndCheck( api, sqlany_error );
|
145
|
+
LookupSymbolAndCheck( api, sqlany_sqlstate );
|
146
|
+
LookupSymbolAndCheck( api, sqlany_clear_error );
|
147
|
+
api->initialized = 1;
|
148
|
+
return 1;
|
149
|
+
}
|
150
|
+
#undef LookupSymbolAndCheck
|
151
|
+
|
152
|
+
void sqlany_finalize_interface( SQLAnywhereInterface * api )
|
153
|
+
/***********************************************************/
|
154
|
+
{
|
155
|
+
if( !api->initialized ) {
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
unloadLibrary( api->dll_handle );
|
159
|
+
memset( api, 0, sizeof(*api));
|
160
|
+
}
|
161
|
+
|
162
|
+
|
data/ext/sacapidll.h
ADDED
@@ -0,0 +1,253 @@
|
|
1
|
+
/* ====================================================
|
2
|
+
*
|
3
|
+
* Copyright 2008 iAnywhere Solutions, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
*
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* While not a requirement of the license, if you do modify this file, we
|
19
|
+
* would appreciate hearing about it. Please email
|
20
|
+
* sqlany_interfaces@sybase.com
|
21
|
+
*
|
22
|
+
* ====================================================
|
23
|
+
*/
|
24
|
+
|
25
|
+
#ifndef SACAPIDLL_H
|
26
|
+
#define SACAPIDLL_H
|
27
|
+
|
28
|
+
#include "sacapi.h"
|
29
|
+
|
30
|
+
/** \file sacapidll.h
|
31
|
+
* \brief Header file for stub that can dynamically load the main API DLL.
|
32
|
+
* The user will need to include sacapidll.h in their source files and compile in sacapidll.c
|
33
|
+
*/
|
34
|
+
|
35
|
+
|
36
|
+
#if defined( __cplusplus )
|
37
|
+
extern "C" {
|
38
|
+
#endif
|
39
|
+
typedef sacapi_bool (*sqlany_init_func)( const char * app_name, sacapi_u32 api_version, sacapi_u32 * max_version );
|
40
|
+
typedef void (*sqlany_fini_func)();
|
41
|
+
typedef a_sqlany_connection * (*sqlany_new_connection_func)( );
|
42
|
+
typedef void (*sqlany_free_connection_func)( a_sqlany_connection *sqlany_conn );
|
43
|
+
typedef a_sqlany_connection * (*sqlany_make_connection_func)( void * arg );
|
44
|
+
typedef sacapi_bool (*sqlany_connect_func)( a_sqlany_connection * sqlany_conn, const char * str );
|
45
|
+
typedef sacapi_bool (*sqlany_disconnect_func)( a_sqlany_connection * sqlany_conn );
|
46
|
+
typedef sacapi_bool (*sqlany_execute_immediate_func)( a_sqlany_connection * sqlany_conn, const char * sql );
|
47
|
+
typedef a_sqlany_stmt * (*sqlany_prepare_func)( a_sqlany_connection * sqlany_conn, const char * sql_str );
|
48
|
+
typedef void (*sqlany_free_stmt_func)( a_sqlany_stmt * sqlany_stmt );
|
49
|
+
typedef sacapi_i32 (*sqlany_num_params_func)( a_sqlany_stmt * sqlany_stmt );
|
50
|
+
typedef sacapi_bool (*sqlany_describe_bind_param_func)( a_sqlany_stmt * sqlany_stmt, sacapi_u32 index, a_sqlany_bind_param * params );
|
51
|
+
typedef sacapi_bool (*sqlany_bind_param_func)( a_sqlany_stmt * sqlany_stmt, sacapi_u32 index, a_sqlany_bind_param * params );
|
52
|
+
typedef sacapi_bool (*sqlany_send_param_data_func)( a_sqlany_stmt * sqlany_stmt, sacapi_u32 index, char * buffer, size_t size );
|
53
|
+
typedef sacapi_bool (*sqlany_reset_func)( a_sqlany_stmt * sqlany_stmt );
|
54
|
+
typedef sacapi_bool (*sqlany_get_bind_param_info_func)( a_sqlany_stmt * sqlany_stmt, sacapi_u32 index, a_sqlany_bind_param_info * info );
|
55
|
+
typedef sacapi_bool (*sqlany_execute_func)( a_sqlany_stmt * sqlany_stmt );
|
56
|
+
typedef a_sqlany_stmt * (*sqlany_execute_direct_func)( a_sqlany_connection * sqlany_conn, const char * sql_str );
|
57
|
+
typedef sacapi_bool (*sqlany_fetch_absolute_func)( a_sqlany_stmt * sqlany_result, sacapi_i32 row_num );
|
58
|
+
typedef sacapi_bool (*sqlany_fetch_next_func)( a_sqlany_stmt * sqlany_stmt );
|
59
|
+
typedef sacapi_bool (*sqlany_get_next_result_func)( a_sqlany_stmt * sqlany_stmt );
|
60
|
+
typedef sacapi_i32 (*sqlany_affected_rows_func)( a_sqlany_stmt * sqlany_stmt );
|
61
|
+
typedef sacapi_i32 (*sqlany_num_cols_func)( a_sqlany_stmt * sqlany_stmt );
|
62
|
+
typedef sacapi_i32 (*sqlany_num_rows_func)( a_sqlany_stmt * sqlany_stmt );
|
63
|
+
typedef sacapi_bool (*sqlany_get_column_func)( a_sqlany_stmt * sqlany_stmt, sacapi_u32 col_index, a_sqlany_data_value * buffer );
|
64
|
+
typedef sacapi_i32 (*sqlany_get_data_func)( a_sqlany_stmt * sqlany_stmt, sacapi_u32 col_index, size_t offset, void * buffer, size_t size );
|
65
|
+
typedef sacapi_bool (*sqlany_get_data_info_func)( a_sqlany_stmt * sqlany_stmt, sacapi_u32 col_index, a_sqlany_data_info * buffer );
|
66
|
+
typedef sacapi_bool (*sqlany_get_column_info_func)( a_sqlany_stmt * sqlany_stmt, sacapi_u32 col_index, a_sqlany_column_info * buffer );
|
67
|
+
typedef sacapi_bool (*sqlany_commit_func)( a_sqlany_connection * sqlany_conn );
|
68
|
+
typedef sacapi_bool (*sqlany_rollback_func)( a_sqlany_connection * sqlany_conn );
|
69
|
+
typedef sacapi_bool (*sqlany_client_version_func)( char * buffer, size_t len );
|
70
|
+
typedef sacapi_i32 (*sqlany_error_func)( a_sqlany_connection * sqlany_conn, char * buffer, size_t size );
|
71
|
+
typedef size_t (*sqlany_sqlstate_func)( a_sqlany_connection * sqlany_conn, char * buffer, size_t size );
|
72
|
+
typedef void (*sqlany_clear_error_func)( a_sqlany_connection * sqlany_conn );
|
73
|
+
|
74
|
+
#if defined( __cplusplus )
|
75
|
+
}
|
76
|
+
#endif
|
77
|
+
|
78
|
+
#define function( x ) x ## _func x
|
79
|
+
/** An API interface structure.
|
80
|
+
* The user would need only one instance of this in their environment. When the
|
81
|
+
* instance is initialized, the DLL will be loaded and all the entry points will be looked up.
|
82
|
+
*/
|
83
|
+
typedef struct SQLAnywhereInterface {
|
84
|
+
/** DLL handle.
|
85
|
+
*/
|
86
|
+
void * dll_handle;
|
87
|
+
|
88
|
+
/** Flag to know if initialized or not.
|
89
|
+
*/
|
90
|
+
int initialized;
|
91
|
+
|
92
|
+
/** Pointer to ::sqlany_init() function.
|
93
|
+
*/
|
94
|
+
function( sqlany_init );
|
95
|
+
|
96
|
+
/** Pointer to ::sqlany_fini() function.
|
97
|
+
*/
|
98
|
+
function( sqlany_fini );
|
99
|
+
|
100
|
+
/** Pointer to ::sqlany_new_connection() function.
|
101
|
+
*/
|
102
|
+
function( sqlany_new_connection );
|
103
|
+
|
104
|
+
/** Pointer to ::sqlany_free_connection() function.
|
105
|
+
*/
|
106
|
+
function( sqlany_free_connection );
|
107
|
+
|
108
|
+
/** Pointer to ::sqlany_make_connection() function.
|
109
|
+
*/
|
110
|
+
function( sqlany_make_connection );
|
111
|
+
|
112
|
+
/** Pointer to ::sqlany_connect() function.
|
113
|
+
*/
|
114
|
+
function( sqlany_connect );
|
115
|
+
|
116
|
+
/** Pointer to ::sqlany_disconnect() function.
|
117
|
+
*/
|
118
|
+
function( sqlany_disconnect );
|
119
|
+
|
120
|
+
/** Pointer to ::sqlany_execute_immediate() function.
|
121
|
+
*/
|
122
|
+
function( sqlany_execute_immediate );
|
123
|
+
|
124
|
+
/** Pointer to ::sqlany_prepare() function.
|
125
|
+
*/
|
126
|
+
function( sqlany_prepare );
|
127
|
+
|
128
|
+
/** Pointer to ::sqlany_free_stmt() function.
|
129
|
+
*/
|
130
|
+
function( sqlany_free_stmt );
|
131
|
+
|
132
|
+
/** Pointer to ::sqlany_num_params() function.
|
133
|
+
*/
|
134
|
+
function( sqlany_num_params );
|
135
|
+
|
136
|
+
/** Pointer to ::sqlany_describe_bind_param() function.
|
137
|
+
*/
|
138
|
+
function( sqlany_describe_bind_param );
|
139
|
+
|
140
|
+
/** Pointer to ::sqlany_bind_param() function.
|
141
|
+
*/
|
142
|
+
function( sqlany_bind_param );
|
143
|
+
|
144
|
+
/** Pointer to ::sqlany_send_param_data() function.
|
145
|
+
*/
|
146
|
+
function( sqlany_send_param_data );
|
147
|
+
|
148
|
+
/** Pointer to ::sqlany_reset() function.
|
149
|
+
*/
|
150
|
+
function( sqlany_reset );
|
151
|
+
|
152
|
+
/** Pointer to ::sqlany_get_bind_param_info() function.
|
153
|
+
*/
|
154
|
+
function( sqlany_get_bind_param_info );
|
155
|
+
|
156
|
+
/** Pointer to ::sqlany_execute() function.
|
157
|
+
*/
|
158
|
+
function( sqlany_execute );
|
159
|
+
|
160
|
+
/** Pointer to ::sqlany_execute_direct() function.
|
161
|
+
*/
|
162
|
+
function( sqlany_execute_direct );
|
163
|
+
|
164
|
+
/** Pointer to ::sqlany_fetch_absolute() function.
|
165
|
+
*/
|
166
|
+
function( sqlany_fetch_absolute );
|
167
|
+
|
168
|
+
/** Pointer to ::sqlany_fetch_next() function.
|
169
|
+
*/
|
170
|
+
function( sqlany_fetch_next );
|
171
|
+
|
172
|
+
/** Pointer to ::sqlany_get_next_result() function.
|
173
|
+
*/
|
174
|
+
function( sqlany_get_next_result );
|
175
|
+
|
176
|
+
/** Pointer to ::sqlany_affected_rows() function.
|
177
|
+
*/
|
178
|
+
function( sqlany_affected_rows );
|
179
|
+
|
180
|
+
/** Pointer to ::sqlany_num_cols() function.
|
181
|
+
*/
|
182
|
+
function( sqlany_num_cols );
|
183
|
+
|
184
|
+
/** Pointer to ::sqlany_num_rows() function.
|
185
|
+
*/
|
186
|
+
function( sqlany_num_rows );
|
187
|
+
|
188
|
+
/** Pointer to ::sqlany_get_column() function.
|
189
|
+
*/
|
190
|
+
function( sqlany_get_column );
|
191
|
+
|
192
|
+
/** Pointer to ::sqlany_get_data() function.
|
193
|
+
*/
|
194
|
+
function( sqlany_get_data );
|
195
|
+
|
196
|
+
/** Pointer to ::sqlany_get_data_info() function.
|
197
|
+
*/
|
198
|
+
function( sqlany_get_data_info );
|
199
|
+
|
200
|
+
/** Pointer to ::sqlany_get_column_info() function.
|
201
|
+
*/
|
202
|
+
function( sqlany_get_column_info );
|
203
|
+
|
204
|
+
/** Pointer to ::sqlany_commit() function.
|
205
|
+
*/
|
206
|
+
function( sqlany_commit );
|
207
|
+
|
208
|
+
/** Pointer to ::sqlany_rollback() function.
|
209
|
+
*/
|
210
|
+
function( sqlany_rollback );
|
211
|
+
|
212
|
+
/** Pointer to ::sqlany_client_version() function.
|
213
|
+
*/
|
214
|
+
function( sqlany_client_version );
|
215
|
+
|
216
|
+
/** Pointer to ::sqlany_error() function.
|
217
|
+
*/
|
218
|
+
function( sqlany_error );
|
219
|
+
|
220
|
+
/** Pointer to ::sqlany_sqlstate() function.
|
221
|
+
*/
|
222
|
+
function( sqlany_sqlstate );
|
223
|
+
|
224
|
+
/** Pointer to ::sqlany_clear_error() function.
|
225
|
+
*/
|
226
|
+
function( sqlany_clear_error );
|
227
|
+
|
228
|
+
} SQLAnywhereInterface;
|
229
|
+
#undef function
|
230
|
+
|
231
|
+
/** Initializes the SQLAnywhereInterface object and loads the DLL dynamically.
|
232
|
+
* This function attempts to load the SQL Anywhere C API DLL dynamically and looks up all
|
233
|
+
* the entry points of the DLL. The fields in the SQLAnywhereInterface structure will be
|
234
|
+
* populated to point to the corresponding functions in the DLL. If the optional path argument
|
235
|
+
* is NULL, the environment variable SQLANY_DLL_PATH will be checked. If the variable is set,
|
236
|
+
* the library will attempt to load the DLL specified by the environment variable. If that fails,
|
237
|
+
* the interface will attempt to load the DLL directly (this relies on the environment being
|
238
|
+
* setup correctly).
|
239
|
+
* \param api An API structure to initialize.
|
240
|
+
* \param optional_path_to_dll An optional argument that specifies a path to the DLL API to load.
|
241
|
+
* \return 1 on successful initialization, and 0 on failure.
|
242
|
+
*/
|
243
|
+
int sqlany_initialize_interface( SQLAnywhereInterface * api, const char * optional_path_to_dll );
|
244
|
+
|
245
|
+
/** Finalize and free resources associated with the SQL Anywhere C API DLL.
|
246
|
+
* This function will unload the library and uninitialize the supplied SQLAnywhereInterface
|
247
|
+
* structure.
|
248
|
+
* \param api An initialized structure to finalize.
|
249
|
+
*/
|
250
|
+
|
251
|
+
void sqlany_finalize_interface( SQLAnywhereInterface * api );
|
252
|
+
|
253
|
+
#endif
|
data/ext/sacapidll.o
ADDED
Binary file
|
data/ext/sqlanywhere.c
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
#include "ruby.h"
|
25
25
|
#include "sacapidll.h"
|
26
26
|
|
27
|
-
const char* VERSION = "0.1.
|
27
|
+
const char* VERSION = "0.1.1";
|
28
28
|
|
29
29
|
// Defining the Ruby Modules
|
30
30
|
static VALUE mSQLAnywhere;
|
@@ -173,10 +173,10 @@ static VALUE C2RB(a_sqlany_data_value* value)
|
|
173
173
|
* looks up all the entry points of the DLL.
|
174
174
|
*
|
175
175
|
* <b>Parameters</b>:
|
176
|
-
* - <tt>VALUE api</tt> --
|
176
|
+
* - <tt>VALUE api</tt> -- An API structure to initialize.
|
177
177
|
*
|
178
178
|
* <b>Returns</b>:
|
179
|
-
* - <tt>result</tt>: <tt>1</tt> on successful initialization, <tt>0</tt> on failure
|
179
|
+
* - <tt>result</tt>: <tt>1</tt> on successful initialization, <tt>0</tt> on failure.
|
180
180
|
*
|
181
181
|
*/
|
182
182
|
static VALUE
|
@@ -198,13 +198,14 @@ static_API_sqlany_initialize_interface(VALUE module, VALUE api)
|
|
198
198
|
*
|
199
199
|
* Finalize and free resources associated with the SQL Anywhere C API DLL.
|
200
200
|
*
|
201
|
-
* This function will unload the library and uninitialize the supplied
|
201
|
+
* This function will unload the library and uninitialize the supplied
|
202
|
+
* SQLAnywhereInterface structure.
|
202
203
|
*
|
203
204
|
* <b>Parameters</b>:
|
204
|
-
* - <tt>VALUE api</tt> --
|
205
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
205
206
|
*
|
206
207
|
* <b>Returns</b>:
|
207
|
-
* - <tt>nil</tt
|
208
|
+
* - <tt>nil</tt>.
|
208
209
|
*
|
209
210
|
*/
|
210
211
|
static VALUE
|
@@ -238,14 +239,14 @@ static_SQLAnywhereInterface_alloc(VALUE class)
|
|
238
239
|
* call-seq:
|
239
240
|
* sqlany_init(VALUE api) -> [VALUE result, VALUE version]
|
240
241
|
*
|
241
|
-
*
|
242
|
+
* Initializes the interface.
|
242
243
|
*
|
243
244
|
* <b>Parameters</b>:
|
244
|
-
* - <tt>VALUE api</tt> --
|
245
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
245
246
|
*
|
246
247
|
* <b>Returns</b>:
|
247
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> on success, <tt>0</tt> on failure
|
248
|
-
* - <tt>VALUE version</tt>: The maximum API version that is supported.
|
248
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> on success, <tt>0</tt> on failure.
|
249
|
+
* - <tt>VALUE version</tt>: The maximum API version that is supported.
|
249
250
|
*
|
250
251
|
*/
|
251
252
|
static VALUE
|
@@ -278,15 +279,15 @@ static_SQLAnywhereInterface_sqlany_init(VALUE api)
|
|
278
279
|
*
|
279
280
|
* Creates a connection object.
|
280
281
|
*
|
281
|
-
* An API connection object needs to be created before a database connection
|
282
|
-
* established. Errors can be retrieved from the connection object. Only
|
283
|
-
* request can be processed on a connection at a time.
|
282
|
+
* An API connection object needs to be created before a database connection
|
283
|
+
* is established. Errors can be retrieved from the connection object. Only
|
284
|
+
* one request can be processed on a connection at a time.
|
284
285
|
*
|
285
286
|
* <b>Parameters</b>:
|
286
|
-
* - <tt>VALUE api</tt> --
|
287
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
287
288
|
*
|
288
289
|
* <b>Returns</b>:
|
289
|
-
* - <tt>VALUE connection</tt>: A connection object.
|
290
|
+
* - <tt>VALUE connection</tt>: A connection object.
|
290
291
|
*
|
291
292
|
*/
|
292
293
|
static VALUE
|
@@ -310,17 +311,17 @@ static_SQLAnywhereInterface_sqlany_new_connection(VALUE api)
|
|
310
311
|
*
|
311
312
|
* Creates a connection object.
|
312
313
|
*
|
313
|
-
* An API connection object needs to be created before a database connection
|
314
|
-
* established. Errors can be retrieved from the connection object. Only
|
315
|
-
* request can be processed on a connection at a time.
|
314
|
+
* An API connection object needs to be created before a database connection
|
315
|
+
* is established. Errors can be retrieved from the connection object. Only
|
316
|
+
* one request can be processed on a connection at a time.
|
316
317
|
*
|
317
318
|
* <b>Parameters</b>:
|
318
|
-
* - <tt>VALUE api</tt> --
|
319
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was created by sqlany_new_connection()
|
320
|
-
* - <tt>VALUE str</tt> -- A SQL Anywhere connection string
|
319
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
320
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was created by sqlany_new_connection().
|
321
|
+
* - <tt>VALUE str</tt> -- A SQL Anywhere connection string.
|
321
322
|
*
|
322
323
|
* <b>Returns</b>:
|
323
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> on success, <tt>0</tt> on failure
|
324
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> on success, <tt>0</tt> on failure.
|
324
325
|
*
|
325
326
|
*/
|
326
327
|
static VALUE
|
@@ -347,14 +348,15 @@ static_SQLAnywhereInterface_sqlany_connect(VALUE api, VALUE sqlany_conn, VALUE s
|
|
347
348
|
*
|
348
349
|
* Disconnect an already established connection.
|
349
350
|
*
|
350
|
-
* This function disconnects a SQL Anywhere connection. Any
|
351
|
+
* This function disconnects a SQL Anywhere connection. Any
|
352
|
+
* uncommitted transactions will be rolled back.
|
351
353
|
*
|
352
354
|
* <b>Parameters</b>:
|
353
|
-
* - <tt>VALUE api</tt> --
|
354
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
355
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
356
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
355
357
|
*
|
356
358
|
* <b>Returns</b>:
|
357
|
-
* - <tt>nil</tt
|
359
|
+
* - <tt>nil</tt>.
|
358
360
|
*
|
359
361
|
*/
|
360
362
|
static VALUE
|
@@ -379,11 +381,11 @@ static_SQLAnywhereInterface_sqlany_disconnect(VALUE api, VALUE sqlany_conn)
|
|
379
381
|
* Frees the resources associated with a connection object.
|
380
382
|
*
|
381
383
|
* <b>Parameters</b>:
|
382
|
-
* - <tt>VALUE api</tt> --
|
383
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was disconnected by sqlany_disconnect()
|
384
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
385
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was disconnected by sqlany_disconnect().
|
384
386
|
*
|
385
387
|
* <b>Returns</b>:
|
386
|
-
* - <tt>nil</tt
|
388
|
+
* - <tt>nil</tt>.
|
387
389
|
*
|
388
390
|
*/
|
389
391
|
static VALUE
|
@@ -405,14 +407,15 @@ static_SQLAnywhereInterface_sqlany_free_connection(VALUE api, VALUE sqlany_conn)
|
|
405
407
|
* call-seq:
|
406
408
|
* sqlany_fini(VALUE api) -> nil
|
407
409
|
*
|
408
|
-
*
|
409
|
-
*
|
410
|
+
* Finalizes the interface.
|
411
|
+
*
|
412
|
+
* Thus function frees any resources allocated by the API.
|
410
413
|
*
|
411
414
|
* <b>Parameters</b>:
|
412
|
-
* - <tt>VALUE api</tt> --
|
415
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
413
416
|
*
|
414
417
|
* <b>Returns</b>:
|
415
|
-
* - <tt>nil</tt
|
418
|
+
* - <tt>nil</tt>.
|
416
419
|
*
|
417
420
|
*/
|
418
421
|
static VALUE
|
@@ -433,15 +436,16 @@ static_SQLAnywhereInterface_sqlany_fini(VALUE api)
|
|
433
436
|
*
|
434
437
|
* Retrieves the last error code and message.
|
435
438
|
*
|
436
|
-
* This function can be used to retrieve the last error code and message
|
439
|
+
* This function can be used to retrieve the last error code and message
|
440
|
+
* stored in the connection object.
|
437
441
|
*
|
438
442
|
* <b>Parameters</b>:
|
439
|
-
* - <tt>VALUE api</tt> --
|
440
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
443
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
444
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
441
445
|
*
|
442
446
|
* <b>Returns</b>:
|
443
447
|
* - <tt>VALUE result</tt>: The last error code. Positive values are warnings, negative values are errors, and <tt>0</tt> is success.
|
444
|
-
* - <tt>VALUE errstr</tt>: The error message corresponding to the error code
|
448
|
+
* - <tt>VALUE errstr</tt>: The error message corresponding to the error code.
|
445
449
|
*
|
446
450
|
*/
|
447
451
|
|
@@ -472,18 +476,19 @@ static_SQLAnywhereInterface_sqlany_error(VALUE api, VALUE sqlany_conn)
|
|
472
476
|
* call-seq:
|
473
477
|
* sqlany_execute_immediate(VALUE api, VALUE sqlany_conn, VALUE sql) -> VALUE result
|
474
478
|
*
|
475
|
-
*
|
479
|
+
* Executes a SQL statement immediately without returning a result set.
|
476
480
|
*
|
477
|
-
*
|
481
|
+
* This function executes the specified SQL statement immediately. It is
|
482
|
+
* useful for SQL statements that do not return a result set.
|
478
483
|
*
|
479
484
|
*
|
480
485
|
* <b>Parameters</b>:
|
481
|
-
* - <tt>VALUE api</tt> --
|
482
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
483
|
-
* - <tt>VALUE sql</tt> -- A SQL query string
|
486
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
487
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
488
|
+
* - <tt>VALUE sql</tt> -- A SQL query string.
|
484
489
|
*
|
485
490
|
* <b>Returns</b>:
|
486
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> on success, <tt>0</tt> on failure
|
491
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> on success, <tt>0</tt> on failure.
|
487
492
|
*
|
488
493
|
*/
|
489
494
|
static VALUE
|
@@ -511,18 +516,20 @@ static_SQLAnywhereInterface_sqlany_execute_immediate(VALUE api, VALUE sqlany_con
|
|
511
516
|
* Executes a SQL statement and possibly returns a result set.
|
512
517
|
*
|
513
518
|
* This function executes the SQL statement specified by the string argument.
|
514
|
-
* This function is suitable if you want to prepare and then execute a
|
515
|
-
* used instead of calling sqlany_prepare() followed
|
519
|
+
* This function is suitable if you want to prepare and then execute a
|
520
|
+
* statement, and can be used instead of calling sqlany_prepare() followed
|
521
|
+
* by sqlany_execute().
|
516
522
|
*
|
517
|
-
* This function
|
523
|
+
* This function cannot be used for executing a SQL statement with
|
524
|
+
* parameters.
|
518
525
|
*
|
519
526
|
* <b>Parameters</b>:
|
520
|
-
* - <tt>VALUE api</tt> --
|
521
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
522
|
-
* - <tt>VALUE sql</tt> -- A SQL query string
|
527
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
528
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
529
|
+
* - <tt>VALUE sql</tt> -- A SQL query string.
|
523
530
|
*
|
524
531
|
* <b>Returns</b>:
|
525
|
-
* - <tt>VALUE result</tt>: A query result set if successful, nil if failed
|
532
|
+
* - <tt>VALUE result</tt>: A query result set if successful, nil if failed.
|
526
533
|
*
|
527
534
|
*/
|
528
535
|
static VALUE
|
@@ -557,11 +564,11 @@ static_SQLAnywhereInterface_sqlany_execute_direct(VALUE api, VALUE sqlany_conn,
|
|
557
564
|
* call-seq:
|
558
565
|
* sqlany_num_cols(VALUE api, VALUE sqlany_stmt) -> VALUE num_cols
|
559
566
|
*
|
560
|
-
* Returns number of columns in the result set
|
567
|
+
* Returns number of columns in the result set.
|
561
568
|
*
|
562
569
|
* <b>Parameters</b>:
|
563
|
-
* - <tt>VALUE api</tt> --
|
564
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct()
|
570
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
571
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct().
|
565
572
|
*
|
566
573
|
* <b>Returns</b>:
|
567
574
|
* - <tt>VALUE num_cols</tt>: The number of columns in the result set or <tt>-1</tt> on a failure.
|
@@ -588,13 +595,13 @@ static_SQLAnywhereInterface_sqlany_num_cols(VALUE api, VALUE sqlany_stmt)
|
|
588
595
|
*
|
589
596
|
* Returns number of rows in the result set.
|
590
597
|
*
|
591
|
-
* By default this function only returns an estimate. To return an exact
|
592
|
-
* users must set the ROW_COUNTS option on the connection.
|
593
|
-
* Refer to SQL Anywhere documentation for the SQL syntax to set this option
|
598
|
+
* By default, this function only returns an estimate. To return an exact
|
599
|
+
* count, users must set the ROW_COUNTS option on the connection.
|
600
|
+
* Refer to SQL Anywhere documentation for the SQL syntax to set this option.
|
594
601
|
*
|
595
602
|
* <b>Parameters</b>:
|
596
|
-
* - <tt>VALUE api</tt> --
|
597
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct()
|
603
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
604
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct().
|
598
605
|
*
|
599
606
|
* <b>Returns</b>:
|
600
607
|
* - <tt>VALUE num_rows</tt>: The number of rows in the result set or <tt>-1</tt> on a failure.
|
@@ -619,15 +626,15 @@ static_SQLAnywhereInterface_sqlany_num_rows(VALUE api, VALUE sqlany_stmt)
|
|
619
626
|
* call-seq:
|
620
627
|
* sqlany_get_column(VALUE api, VALUE sqlany_stmt, VALUE col_num) -> [VALUE result, VALUE column_value]
|
621
628
|
*
|
622
|
-
*
|
629
|
+
* Retrieves the data fetched for the specified column.
|
623
630
|
*
|
624
631
|
* <b>Parameters</b>:
|
625
|
-
* - <tt>VALUE api</tt> --
|
626
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct()
|
632
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
633
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct().
|
627
634
|
* - <tt>VALUE col_num</tt> -- The number of the column to be retrieved. A column number is between 0 and sqlany_num_cols() - 1.
|
628
635
|
*
|
629
636
|
* <b>Returns</b>:
|
630
|
-
* - <tt>VALUE column_value</tt>: The value of the column. nil is returned if the value was NULL
|
637
|
+
* - <tt>VALUE column_value</tt>: The value of the column. nil is returned if the value was NULL.
|
631
638
|
*
|
632
639
|
*/
|
633
640
|
static VALUE
|
@@ -671,17 +678,20 @@ static_SQLAnywhereInterface_sqlany_get_column(VALUE api, VALUE sqlany_stmt, VALU
|
|
671
678
|
* call-seq:
|
672
679
|
* sqlany_fetch_next(VALUE api, VALUE sqlany_stmt) -> VALUE result
|
673
680
|
*
|
674
|
-
*
|
675
|
-
*
|
676
|
-
*
|
677
|
-
*
|
681
|
+
* Fetches the next row from the result set.
|
682
|
+
*
|
683
|
+
* This function fetches the next row from the result set. When the result
|
684
|
+
* object is first created, the current row pointer is set to point before
|
685
|
+
* the first row (that is, row 0).
|
686
|
+
* This function advances the row pointer first and then fetches the data
|
687
|
+
* at the new row.
|
678
688
|
*
|
679
689
|
* <b>Parameters</b>:
|
680
|
-
* - <tt>VALUE api</tt> --
|
681
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct()
|
690
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
691
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct().
|
682
692
|
*
|
683
693
|
* <b>Returns</b>:
|
684
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> on successful fetch, <tt>0</tt> otherwise
|
694
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> on successful fetch, <tt>0</tt> otherwise.
|
685
695
|
*
|
686
696
|
*/
|
687
697
|
static VALUE
|
@@ -703,26 +713,29 @@ static_SQLAnywhereInterface_sqlany_fetch_next(VALUE api, VALUE sqlany_stmt)
|
|
703
713
|
* call-seq:
|
704
714
|
* sqlany_get_column_info(VALUE api, VALUE sqlany_stmt, VALUE col_num) -> [VALUE result, VALUE col_num, VALUE name, VALUE type, VALUE max_size]
|
705
715
|
*
|
706
|
-
*
|
707
|
-
*
|
708
|
-
*
|
709
|
-
*
|
716
|
+
* Fetches the next row from the result set.
|
717
|
+
*
|
718
|
+
* This function fetches the next row from the result set. When the result
|
719
|
+
* object is first created, the current row pointer is set to point before
|
720
|
+
* the first row (that is, row 0).
|
721
|
+
* This function advances the row pointer first and then fetches the data
|
722
|
+
* at the new row.
|
710
723
|
*
|
711
724
|
* <b>Parameters</b>:
|
712
|
-
* - <tt>VALUE api</tt> --
|
713
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct()
|
725
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
726
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct().
|
714
727
|
* - <tt>VALUE col_num</tt> -- The number of the column to be retrieved. A column number is between 0 and sqlany_num_cols() - 1.
|
715
728
|
*
|
716
729
|
* <b>Returns</b>:
|
717
730
|
* - <tt>VALUE result</tt>: <tt>1</tt> on success. Returns <tt>0</tt> if the column index is out of range, or if the statement does not return a result set.
|
718
|
-
* - <tt>VALUE col_num</tt>: The number of the column retrieved
|
719
|
-
* - <tt>VALUE name</tt>: The name of the column
|
720
|
-
* - <tt>VALUE type</tt>: The type of the column data
|
721
|
-
* - <tt>VALUE native_type</tt>: The SQL Anywhere native type of the column data
|
722
|
-
* - <tt>VALUE precision</tt>: The precision of the column
|
723
|
-
* - <tt>VALUE scale</tt>: The scale of the column
|
724
|
-
* - <tt>VALUE max_size</tt>: The maximum size a data value in this column can take
|
725
|
-
* - <tt>VALUE nullable</tt>: The nullability of the column
|
731
|
+
* - <tt>VALUE col_num</tt>: The number of the column retrieved.
|
732
|
+
* - <tt>VALUE name</tt>: The name of the column.
|
733
|
+
* - <tt>VALUE type</tt>: The type of the column data.
|
734
|
+
* - <tt>VALUE native_type</tt>: The SQL Anywhere native type of the column data.
|
735
|
+
* - <tt>VALUE precision</tt>: The precision of the column.
|
736
|
+
* - <tt>VALUE scale</tt>: The scale of the column.
|
737
|
+
* - <tt>VALUE max_size</tt>: The maximum size a data value in this column can take.
|
738
|
+
* - <tt>VALUE nullable</tt>: The nullability of the column.
|
726
739
|
*
|
727
740
|
*/
|
728
741
|
static VALUE
|
@@ -759,14 +772,14 @@ static_SQLAnywhereInterface_sqlany_get_column_info(VALUE api, VALUE sqlany_stmt,
|
|
759
772
|
* call-seq:
|
760
773
|
* sqlany_commit(VALUE api, VALUE sqlany_conn) -> VALUE result
|
761
774
|
*
|
762
|
-
*
|
775
|
+
* Commits the current transaction.
|
763
776
|
*
|
764
777
|
* <b>Parameters</b>:
|
765
|
-
* - <tt>VALUE api</tt> --
|
766
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
778
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
779
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
767
780
|
*
|
768
781
|
* <b>Returns</b>:
|
769
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> on successful commit, <tt>0</tt> otherwise
|
782
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> on successful commit, <tt>0</tt> otherwise.
|
770
783
|
*
|
771
784
|
*/
|
772
785
|
static VALUE
|
@@ -789,14 +802,14 @@ static_SQLAnywhereInterface_sqlany_commit(VALUE api, VALUE sqlany_conn)
|
|
789
802
|
* call-seq:
|
790
803
|
* sqlany_rollback(VALUE api, VALUE sqlany_conn) -> VALUE result
|
791
804
|
*
|
792
|
-
*
|
805
|
+
* Rolls back the current transaction.
|
793
806
|
*
|
794
807
|
* <b>Parameters</b>:
|
795
|
-
* - <tt>VALUE api</tt> --
|
796
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
808
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
809
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
797
810
|
*
|
798
811
|
* <b>Returns</b>:
|
799
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> on successful rollback, <tt>0</tt> otherwise
|
812
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> on successful rollback, <tt>0</tt> otherwise.
|
800
813
|
*
|
801
814
|
*/
|
802
815
|
static VALUE
|
@@ -818,16 +831,17 @@ static_SQLAnywhereInterface_sqlany_rollback(VALUE api, VALUE sqlany_conn)
|
|
818
831
|
* call-seq:
|
819
832
|
* sqlany_prepare(VALUE api, VALUE sqlany_conn, VALUE sql) -> VALUE stmt
|
820
833
|
*
|
821
|
-
*
|
834
|
+
* Prepares a SQL statement.
|
822
835
|
*
|
823
|
-
* This function prepares the supplied SQL string. Execution does not
|
824
|
-
* is called. The returned statement object
|
836
|
+
* This function prepares the supplied SQL string. Execution does not
|
837
|
+
* happen until sqlany_execute() is called. The returned statement object
|
838
|
+
* should be freed using sqlany_free_stmt().
|
825
839
|
*
|
826
840
|
*
|
827
841
|
* <b>Parameters</b>:
|
828
|
-
* - <tt>VALUE api</tt> --
|
829
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
830
|
-
* - <tt>VALUE sql</tt> -- SQL query to prepare
|
842
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
843
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
844
|
+
* - <tt>VALUE sql</tt> -- SQL query to prepare.
|
831
845
|
*
|
832
846
|
* <b>Returns</b>:
|
833
847
|
* - <tt>VALUE stmt</tt>: A statement object, or nil on failure. The statement object can be used by sqlany_execute() to execute the statement.
|
@@ -868,14 +882,15 @@ static_SQLAnywhereInterface_sqlany_prepare(VALUE api, VALUE sqlany_conn, VALUE s
|
|
868
882
|
*
|
869
883
|
* Frees resources associated with a prepared statement object.
|
870
884
|
*
|
871
|
-
* This function frees the resources associated with a prepared statement
|
885
|
+
* This function frees the resources associated with a prepared statement
|
886
|
+
* object.
|
872
887
|
*
|
873
888
|
* <b>Parameters</b>:
|
874
|
-
* - <tt>VALUE api</tt> --
|
875
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct()
|
889
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
890
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct().
|
876
891
|
*
|
877
892
|
* <b>Returns</b>:
|
878
|
-
* - <tt>nil</tt
|
893
|
+
* - <tt>nil</tt>.
|
879
894
|
*
|
880
895
|
*/
|
881
896
|
static VALUE
|
@@ -918,14 +933,14 @@ static_SQLAnywhereInterface_sqlany_free_stmt(VALUE api, VALUE sqlany_stmt)
|
|
918
933
|
* call-seq:
|
919
934
|
* sqlany_execute(VALUE api, VALUE sqlany_stmt) -> VALUE result
|
920
935
|
*
|
921
|
-
*
|
936
|
+
* Executes a prepared statement.
|
922
937
|
*
|
923
938
|
* <b>Parameters</b>:
|
924
|
-
* - <tt>VALUE api</tt> --
|
925
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct()
|
939
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
940
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was created by sqlany_prepare() or sqlany_execute_direct().
|
926
941
|
*
|
927
942
|
* <b>Returns</b>:
|
928
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> on successful execution, <tt>0</tt> otherwise
|
943
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> on successful execution, <tt>0</tt> otherwise.
|
929
944
|
*
|
930
945
|
*/
|
931
946
|
static VALUE
|
@@ -947,10 +962,11 @@ static_SQLAnywhereInterface_sqlany_execute(VALUE api, VALUE sqlany_stmt)
|
|
947
962
|
* call-seq:
|
948
963
|
* sqlany_affected_rows(VALUE api, VALUE sqlany_stmt) -> VALUE result
|
949
964
|
*
|
950
|
-
* Returns the number of rows affected by execution of the prepared
|
965
|
+
* Returns the number of rows affected by execution of the prepared
|
966
|
+
* statement.
|
951
967
|
*
|
952
968
|
* <b>Parameters</b>:
|
953
|
-
* - <tt>VALUE api</tt> --
|
969
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
954
970
|
* - <tt>VALUE sqlany_stmt</tt> -- A statement that was prepared and executed successfully with no result set returned.
|
955
971
|
*
|
956
972
|
* <b>Returns</b>:
|
@@ -978,14 +994,16 @@ static_SQLAnywhereInterface_sqlany_affected_rows(VALUE api, VALUE sqlany_stmt)
|
|
978
994
|
*
|
979
995
|
* Describes the bind parameters of a prepared statement.
|
980
996
|
*
|
981
|
-
* This function allows the caller to determine information about parameters
|
982
|
-
* Depending on the type of the prepared statement
|
983
|
-
*
|
997
|
+
* This function allows the caller to determine information about parameters
|
998
|
+
* to a prepared statement. Depending on the type of the prepared statement
|
999
|
+
* (call to stored procedure or a DML), only some information will be
|
1000
|
+
* provided. The information that will always be provided is the direction
|
1001
|
+
* of the parameters (input, output, or input-output).
|
984
1002
|
*
|
985
1003
|
* <b>Parameters</b>:
|
986
|
-
* - <tt>VALUE api</tt> --
|
1004
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
987
1005
|
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was returned from sqlany_prepare().
|
988
|
-
* - <tt>VALUE index</tt> -- The index of the parameter. This should be a number between 0 and sqlany_num_params()- 1
|
1006
|
+
* - <tt>VALUE index</tt> -- The index of the parameter. This should be a number between 0 and sqlany_num_params()- 1.
|
989
1007
|
*
|
990
1008
|
* <b>Returns</b>:
|
991
1009
|
* - <tt>VALUE result</tt>: <tt>1</tt> on success or <tt>0</tt> on failure.
|
@@ -1028,13 +1046,13 @@ static_SQLAnywhereInterface_sqlany_describe_bind_param(VALUE api, VALUE sqlany_s
|
|
1028
1046
|
* call-seq:
|
1029
1047
|
* sqlany_bind_param(VALUE api, VALUE sqlany_stmt, VALUE index, VALUE sqlany_bind_param) -> VALUE result
|
1030
1048
|
*
|
1031
|
-
*
|
1049
|
+
* Binds a user supplied buffer as a parameter to the prepared statement.
|
1032
1050
|
*
|
1033
1051
|
* <b>Parameters</b>:
|
1034
|
-
* - <tt>VALUE api</tt> --
|
1052
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
1035
1053
|
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was returned from sqlany_prepare().
|
1036
|
-
* - <tt>VALUE index</tt> -- The index of the parameter. This should be a number between 0 and sqlany_num_params() - 1
|
1037
|
-
* - <tt>VALUE sqlany_bind_param</tt> -- A filled bind object retrieved from sqlany_describe_bind_param()
|
1054
|
+
* - <tt>VALUE index</tt> -- The index of the parameter. This should be a number between 0 and sqlany_num_params() - 1.
|
1055
|
+
* - <tt>VALUE sqlany_bind_param</tt> -- A filled bind object retrieved from sqlany_describe_bind_param().
|
1038
1056
|
*
|
1039
1057
|
* <b>Returns</b>:
|
1040
1058
|
* - <tt>VALUE result</tt>: <tt>1</tt> on success or <tt>0</tt> on failure.
|
@@ -1063,14 +1081,15 @@ static_SQLAnywhereInterface_sqlany_bind_param(VALUE api, VALUE sqlany_stmt, VALU
|
|
1063
1081
|
* call-seq:
|
1064
1082
|
* sqlany_get_bind_param_info(VALUE api, VALUE sqlany_stmt, VALUE index) -> [VALUE result, VALUE bind_param]
|
1065
1083
|
*
|
1066
|
-
*
|
1084
|
+
* Gets bound parameter info.
|
1067
1085
|
*
|
1068
|
-
* This function retrieves information about the parameters that were
|
1086
|
+
* This function retrieves information about the parameters that were
|
1087
|
+
* bound using sqlany_bind_param().
|
1069
1088
|
*
|
1070
1089
|
* <b>Parameters</b>:
|
1071
|
-
* - <tt>VALUE api</tt> --
|
1090
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
1072
1091
|
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was returned from sqlany_prepare().
|
1073
|
-
* - <tt>VALUE index</tt> -- The index of the parameter. This should be a number between 0 and sqlany_num_params() - 1
|
1092
|
+
* - <tt>VALUE index</tt> -- The index of the parameter. This should be a number between 0 and sqlany_num_params() - 1.
|
1074
1093
|
*
|
1075
1094
|
* <b>Returns</b>:
|
1076
1095
|
* - <tt>VALUE result</tt>: <tt>1</tt> on success or <tt>0</tt> on failure.
|
@@ -1110,12 +1129,14 @@ static_SQLAnywhereInterface_sqlany_get_bind_param_info(VALUE api, VALUE sqlany_s
|
|
1110
1129
|
* call-seq:
|
1111
1130
|
* sqlany_num_params(VALUE api, VALUE sqlany_stmt) -> VALUE result
|
1112
1131
|
*
|
1113
|
-
* Returns the number of parameters that are expected for a prepared
|
1132
|
+
* Returns the number of parameters that are expected for a prepared
|
1133
|
+
* statement.
|
1114
1134
|
*
|
1115
|
-
* This function retrieves information about the parameters that were bound
|
1135
|
+
* This function retrieves information about the parameters that were bound
|
1136
|
+
* using sqlany_bind_param().
|
1116
1137
|
*
|
1117
1138
|
* <b>Parameters</b>:
|
1118
|
-
* - <tt>VALUE api</tt> --
|
1139
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
1119
1140
|
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was returned from sqlany_prepare().
|
1120
1141
|
*
|
1121
1142
|
* <b>Returns</b>:
|
@@ -1141,18 +1162,18 @@ static_SQLAnywhereInterface_sqlany_num_params(VALUE api, VALUE sqlany_stmt)
|
|
1141
1162
|
* call-seq:
|
1142
1163
|
* sqlany_get_next_result(VALUE api, VALUE sqlany_stmt) -> VALUE result
|
1143
1164
|
*
|
1144
|
-
*
|
1165
|
+
* Advances to the next result set in a multiple result set query.
|
1145
1166
|
*
|
1146
|
-
* If a query (such as a call to a stored procedure) returns multiple result
|
1147
|
-
* then this function advances from the current result set to the next.
|
1167
|
+
* If a query (such as a call to a stored procedure) returns multiple result
|
1168
|
+
* sets, then this function advances from the current result set to the next.
|
1148
1169
|
*
|
1149
1170
|
*
|
1150
1171
|
* <b>Parameters</b>:
|
1151
|
-
* - <tt>VALUE api</tt> --
|
1152
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was executed by sqlany_execute() or sqlany_execute_direct()
|
1172
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
1173
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was executed by sqlany_execute() or sqlany_execute_direct().
|
1153
1174
|
*
|
1154
1175
|
* <b>Returns</b>:
|
1155
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> if was successfully able to advance to the next result set, <tt>0</tt> otherwise
|
1176
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> if was successfully able to advance to the next result set, <tt>0</tt> otherwise.
|
1156
1177
|
*
|
1157
1178
|
*/
|
1158
1179
|
static VALUE
|
@@ -1174,17 +1195,18 @@ static_SQLAnywhereInterface_sqlany_get_next_result(VALUE api, VALUE sqlany_stmt)
|
|
1174
1195
|
* call-seq:
|
1175
1196
|
* sqlany_fetch_absolute(VALUE api, VALUE sqlany_stmt, VALUE offset) -> VALUE result
|
1176
1197
|
*
|
1177
|
-
*
|
1198
|
+
* Fetches data at a specific row number in the result set.
|
1178
1199
|
*
|
1179
|
-
* This function moves the current row in the result set to the row number
|
1200
|
+
* This function moves the current row in the result set to the row number
|
1201
|
+
* specified and fetches the data at that row.
|
1180
1202
|
*
|
1181
1203
|
* <b>Parameters</b>:
|
1182
|
-
* - <tt>VALUE api</tt> --
|
1183
|
-
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was executed by sqlany_execute() or sqlany_execute_direct()
|
1184
|
-
* - <tt>VALUE offset</tt> --
|
1204
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
1205
|
+
* - <tt>VALUE sqlany_stmt</tt> -- A statement object that was executed by sqlany_execute() or sqlany_execute_direct().
|
1206
|
+
* - <tt>VALUE offset</tt> -- The row number to be fetched. The first row is <tt>1</tt>, the last row is <tt>-1</tt>.
|
1185
1207
|
*
|
1186
1208
|
* <b>Returns</b>:
|
1187
|
-
* - <tt>VALUE result</tt>: <tt>1</tt> if the fetch was successfully, <tt>0</tt> otherwise
|
1209
|
+
* - <tt>VALUE result</tt>: <tt>1</tt> if the fetch was successfully, <tt>0</tt> otherwise.
|
1188
1210
|
*
|
1189
1211
|
*/
|
1190
1212
|
static VALUE
|
@@ -1207,14 +1229,14 @@ static_SQLAnywhereInterface_sqlany_fetch_absolute(VALUE api, VALUE sqlany_stmt,
|
|
1207
1229
|
* call-seq:
|
1208
1230
|
* sqlany_sqlstate(VALUE api, VALUE sqlany_conn) -> VALUE sqlstate_str
|
1209
1231
|
*
|
1210
|
-
*
|
1232
|
+
* Retrieves the current SQL state.
|
1211
1233
|
*
|
1212
1234
|
* <b>Parameters</b>:
|
1213
|
-
* - <tt>VALUE api</tt> --
|
1214
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
1235
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
1236
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
1215
1237
|
*
|
1216
1238
|
* <b>Returns</b>:
|
1217
|
-
* - <tt>VALUE sqlstate_str</tt>: The SQL State
|
1239
|
+
* - <tt>VALUE sqlstate_str</tt>: The SQL State.
|
1218
1240
|
*
|
1219
1241
|
*/
|
1220
1242
|
static VALUE
|
@@ -1240,11 +1262,11 @@ static_SQLAnywhereInterface_sqlany_sqlstate(VALUE api, VALUE sqlany_conn)
|
|
1240
1262
|
* Clears the last stored error code.
|
1241
1263
|
*
|
1242
1264
|
* <b>Parameters</b>:
|
1243
|
-
* - <tt>VALUE api</tt> --
|
1244
|
-
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect()
|
1265
|
+
* - <tt>VALUE api</tt> -- An initialized API structure to finalize.
|
1266
|
+
* - <tt>VALUE sqlany_conn</tt> -- A connection object that was connected by sqlany_connect().
|
1245
1267
|
*
|
1246
1268
|
* <b>Returns</b>:
|
1247
|
-
* - <tt>nil</tt
|
1269
|
+
* - <tt>nil</tt>:.
|
1248
1270
|
*
|
1249
1271
|
*/
|
1250
1272
|
static VALUE
|
@@ -1265,13 +1287,13 @@ static_SQLAnywhereInterface_sqlany_clear_error(VALUE api, VALUE sqlany_conn)
|
|
1265
1287
|
* call-seq:
|
1266
1288
|
* get_name(VALUE bind) -> VALUE name
|
1267
1289
|
*
|
1268
|
-
*
|
1290
|
+
* Gets the name of the bound parameter.
|
1269
1291
|
*
|
1270
1292
|
* <b>Parameters</b>:
|
1271
|
-
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param()
|
1293
|
+
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param().
|
1272
1294
|
*
|
1273
1295
|
* <b>Returns</b>:
|
1274
|
-
* - <tt>VALUE name</tt>: The bound variable's name
|
1296
|
+
* - <tt>VALUE name</tt>: The bound variable's name.
|
1275
1297
|
*
|
1276
1298
|
*/
|
1277
1299
|
static VALUE
|
@@ -1286,11 +1308,11 @@ static_Bind_get_name(VALUE bind)
|
|
1286
1308
|
* call-seq:
|
1287
1309
|
* set_value(VALUE bind, VALUE val) -> nil
|
1288
1310
|
*
|
1289
|
-
*
|
1311
|
+
* Sets the value of a bind parameter.
|
1290
1312
|
*
|
1291
|
-
*
|
1292
|
-
* If the bind_direction is INPUT only, the type INPUT
|
1293
|
-
* based on the RUBY type:
|
1313
|
+
* This function is used to bind a Ruby VALUE to a given parameter in a
|
1314
|
+
* prepared statement. If the bind_direction is INPUT only, the type INPUT
|
1315
|
+
* will be bound based on the RUBY type:
|
1294
1316
|
*
|
1295
1317
|
* +-------------+------------+
|
1296
1318
|
* | Ruby Type | Bind Type |
|
@@ -1303,17 +1325,18 @@ static_Bind_get_name(VALUE bind)
|
|
1303
1325
|
* | T_NIL => isnull = 1 |
|
1304
1326
|
* +--------------------------+
|
1305
1327
|
*
|
1306
|
-
* If the bind direction is
|
1328
|
+
* If the bind direction is OUTPUT, instead use the DBCAPI type to set the
|
1329
|
+
* size of the buffer.
|
1307
1330
|
*
|
1308
|
-
* In the case of INOUT parameters, it is the
|
1309
|
-
* once to bind the INPUT, once to bind the OUTPUT
|
1331
|
+
* In the case of INOUT parameters, it is the application's job to call this
|
1332
|
+
* method twice, once to bind the INPUT, and once to bind the OUTPUT.
|
1310
1333
|
*
|
1311
1334
|
* <b>Parameters</b>:
|
1312
|
-
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param()
|
1313
|
-
* - <tt>VALUE val</tt> -- The value to bind into the bound variable
|
1335
|
+
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param().
|
1336
|
+
* - <tt>VALUE val</tt> -- The value to bind into the bound variable.
|
1314
1337
|
*
|
1315
1338
|
* <b>Returns</b>:
|
1316
|
-
* - <tt>nil</tt
|
1339
|
+
* - <tt>nil</tt>.
|
1317
1340
|
*/
|
1318
1341
|
static VALUE
|
1319
1342
|
static_Bind_set_value(VALUE bind, VALUE val)
|
@@ -1402,14 +1425,14 @@ static_Bind_set_value(VALUE bind, VALUE val)
|
|
1402
1425
|
* call-seq:
|
1403
1426
|
* set_direction(VALUE bind, VALUE direction) -> nil
|
1404
1427
|
*
|
1405
|
-
*
|
1428
|
+
* Sets the direction of the bound parameter before binding.
|
1406
1429
|
*
|
1407
1430
|
* <b>Parameters</b>:
|
1408
|
-
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param()
|
1409
|
-
* - <tt>VALUE direction</tt> -- The direction of the binding variable
|
1431
|
+
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param().
|
1432
|
+
* - <tt>VALUE direction</tt> -- The direction of the binding variable.
|
1410
1433
|
*
|
1411
1434
|
* <b>Returns</b>:
|
1412
|
-
* - <tt>nil</tt
|
1435
|
+
* - <tt>nil</tt>.
|
1413
1436
|
*
|
1414
1437
|
*/
|
1415
1438
|
static VALUE
|
@@ -1428,14 +1451,15 @@ static_Bind_set_direction(VALUE bind, VALUE direction)
|
|
1428
1451
|
* call-seq:
|
1429
1452
|
* set_buffer_size(VALUE bind, VALUE size) -> nil
|
1430
1453
|
*
|
1431
|
-
*
|
1454
|
+
* Sets the buffer size of INOUT and OUT parameters for string and binary
|
1455
|
+
* data.
|
1432
1456
|
*
|
1433
1457
|
* <b>Parameters</b>:
|
1434
|
-
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param()
|
1435
|
-
* - <tt>VALUE size</tt> -- The size of the buffer to hold the INOUT or OUT parameter
|
1458
|
+
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param().
|
1459
|
+
* - <tt>VALUE size</tt> -- The size of the buffer to hold the INOUT or OUT parameter.
|
1436
1460
|
*
|
1437
1461
|
* <b>Returns</b>:
|
1438
|
-
* - <tt>nil</tt
|
1462
|
+
* - <tt>nil</tt>.
|
1439
1463
|
*
|
1440
1464
|
*/
|
1441
1465
|
static VALUE
|
@@ -1454,13 +1478,13 @@ static_Bind_set_buffer_size(VALUE bind, VALUE size)
|
|
1454
1478
|
* call-seq:
|
1455
1479
|
* get_direction(VALUE bind) -> VALUE direction
|
1456
1480
|
*
|
1457
|
-
*
|
1481
|
+
* Gets the direction of the bound parameter.
|
1458
1482
|
*
|
1459
1483
|
* <b>Parameters</b>:
|
1460
|
-
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param()
|
1484
|
+
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param().
|
1461
1485
|
*
|
1462
1486
|
* <b>Returns</b>:
|
1463
|
-
* - <tt>VALUE name</tt>: The direction of the bound parameter
|
1487
|
+
* - <tt>VALUE name</tt>: The direction of the bound parameter.
|
1464
1488
|
*
|
1465
1489
|
*/
|
1466
1490
|
static VALUE
|
@@ -1476,13 +1500,13 @@ static_Bind_get_direction(VALUE bind)
|
|
1476
1500
|
* call-seq:
|
1477
1501
|
* finish(VALUE bind) -> nil
|
1478
1502
|
*
|
1479
|
-
*
|
1503
|
+
* Frees the resources associated with the bound parameter.
|
1480
1504
|
*
|
1481
1505
|
* <b>Parameters</b>:
|
1482
|
-
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param()
|
1506
|
+
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param().
|
1483
1507
|
*
|
1484
1508
|
* <b>Returns</b>:
|
1485
|
-
* - <tt>nil</tt
|
1509
|
+
* - <tt>nil</tt>.
|
1486
1510
|
*
|
1487
1511
|
*/
|
1488
1512
|
static VALUE
|
@@ -1502,13 +1526,13 @@ static_Bind_finish(VALUE bind)
|
|
1502
1526
|
* call-seq:
|
1503
1527
|
* get_info_direction(VALUE bind) -> VALUE direction
|
1504
1528
|
*
|
1505
|
-
*
|
1529
|
+
* Gets the name of the bound parameter info object.
|
1506
1530
|
*
|
1507
1531
|
* <b>Parameters</b>:
|
1508
|
-
* - <tt>VALUE bind</tt> -- Bound parameter info retrieved from sqlany_describe_bind_param_info()
|
1532
|
+
* - <tt>VALUE bind</tt> -- Bound parameter info retrieved from sqlany_describe_bind_param_info().
|
1509
1533
|
*
|
1510
1534
|
* <b>Returns</b>:
|
1511
|
-
* - <tt>VALUE direction</tt>: The bound variable's direction
|
1535
|
+
* - <tt>VALUE direction</tt>: The bound variable's direction.
|
1512
1536
|
*
|
1513
1537
|
*/
|
1514
1538
|
static VALUE
|
@@ -1524,13 +1548,13 @@ static_Bind_get_info_direction(VALUE bind)
|
|
1524
1548
|
* call-seq:
|
1525
1549
|
* get_info_output(VALUE bind) -> VALUE name
|
1526
1550
|
*
|
1527
|
-
*
|
1551
|
+
* Gets the value of a bound parameter after execution.
|
1528
1552
|
*
|
1529
1553
|
* <b>Parameters</b>:
|
1530
|
-
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param()
|
1554
|
+
* - <tt>VALUE bind</tt> -- Bound parameter retrieved from sqlany_describe_bind_param().
|
1531
1555
|
*
|
1532
1556
|
* <b>Returns</b>:
|
1533
|
-
* - <tt>VALUE name</tt>: The bound variable value
|
1557
|
+
* - <tt>VALUE name</tt>: The bound variable value.
|
1534
1558
|
*
|
1535
1559
|
*/
|
1536
1560
|
static VALUE
|
@@ -1616,7 +1640,7 @@ void Init_sqlanywhere()
|
|
1616
1640
|
rb_define_method(cA_sqlany_bind_param, "set_buffer_size", static_Bind_set_buffer_size, 1);
|
1617
1641
|
rb_define_method(cA_sqlany_bind_param, "finish", static_Bind_finish, 0);
|
1618
1642
|
|
1619
|
-
// Define methods for
|
1643
|
+
// Define methods for obtaining bind_parameter_info fields
|
1620
1644
|
rb_define_method(cA_sqlany_bind_param_info, "get_direction", static_Bind_get_info_direction, 0);
|
1621
1645
|
rb_define_method(cA_sqlany_bind_param_info, "get_output", static_Bind_get_info_output, 0);
|
1622
1646
|
}
|