34
34
#include <sqlext.h>
35
35
#endif
36
36
37
- /* Bind parameters on a statement handle */
37
+ // Bind parameters on a statement handle
38
38
39
39
RETCODE SQL_API SQLBindParameter (
40
40
HSTMT hstmt ,
@@ -75,18 +75,18 @@ static char *func="SQLBindParameter";
75
75
76
76
stmt -> parameters_allocated = ipar ;
77
77
78
- /* copy the old parameters over */
78
+ // copy the old parameters over
79
79
for (i = 0 ; i < old_parameters_allocated ; i ++ ) {
80
- /* a structure copy should work */
80
+ // a structure copy should work
81
81
stmt -> parameters [i ] = old_parameters [i ];
82
82
}
83
83
84
- /* get rid of the old parameters, if there were any */
84
+ // get rid of the old parameters, if there were any
85
85
if (old_parameters )
86
86
free (old_parameters );
87
87
88
- /* zero out the newly allocated parameters (in case they skipped some, */
89
- /* so we don't accidentally try to use them later) */
88
+ // zero out the newly allocated parameters (in case they skipped some,
89
+ // so we don't accidentally try to use them later)
90
90
for (; i < stmt -> parameters_allocated ; i ++ ) {
91
91
stmt -> parameters [i ].buflen = 0 ;
92
92
stmt -> parameters [i ].buffer = 0 ;
@@ -105,7 +105,7 @@ static char *func="SQLBindParameter";
105
105
106
106
ipar -- ; /* use zero based column numbers for the below part */
107
107
108
- /* store the given info */
108
+ // store the given info
109
109
stmt -> parameters [ipar ].buflen = cbValueMax ;
110
110
stmt -> parameters [ipar ].buffer = rgbValue ;
111
111
stmt -> parameters [ipar ].used = pcbValue ;
@@ -140,9 +140,9 @@ static char *func="SQLBindParameter";
140
140
return SQL_SUCCESS ;
141
141
}
142
142
143
- /* - - - - - - - - - */
143
+ // - - - - - - - - -
144
144
145
- /* Associate a user-supplied buffer with a database column. */
145
+ // Associate a user-supplied buffer with a database column.
146
146
RETCODE SQL_API SQLBindCol (
147
147
HSTMT hstmt ,
148
148
UWORD icol ,
@@ -195,14 +195,14 @@ mylog("**** SQLBindCol: stmt = %u, icol = %d\n", stmt, icol);
195
195
return SQL_SUCCESS ;
196
196
}
197
197
198
- /* allocate enough bindings if not already done */
199
- /* Most likely, execution of a statement would have setup the */
200
- /* necessary bindings. But some apps call BindCol before any */
201
- /* statement is executed. */
198
+ // allocate enough bindings if not already done
199
+ // Most likely, execution of a statement would have setup the
200
+ // necessary bindings. But some apps call BindCol before any
201
+ // statement is executed.
202
202
if ( icol > stmt -> bindings_allocated )
203
203
extend_bindings (stmt , icol );
204
204
205
- /* check to see if the bindings were allocated */
205
+ // check to see if the bindings were allocated
206
206
if ( ! stmt -> bindings ) {
207
207
stmt -> errormsg = "Could not allocate memory for bindings." ;
208
208
stmt -> errornumber = STMT_NO_MEMORY_ERROR ;
@@ -234,14 +234,14 @@ mylog("**** SQLBindCol: stmt = %u, icol = %d\n", stmt, icol);
234
234
return SQL_SUCCESS ;
235
235
}
236
236
237
- /* - - - - - - - - - */
237
+ // - - - - - - - - -
238
238
239
- /* Returns the description of a parameter marker. */
240
- /* This function is listed as not being supported by SQLGetFunctions() because it is */
241
- /* used to describe "parameter markers" (not bound parameters), in which case, */
242
- /* the dbms should return info on the markers. Since Postgres doesn't support that, */
243
- /* it is best to say this function is not supported and let the application assume a */
244
- /* data type (most likely varchar). */
239
+ // Returns the description of a parameter marker.
240
+ // This function is listed as not being supported by SQLGetFunctions() because it is
241
+ // used to describe "parameter markers" (not bound parameters), in which case,
242
+ // the dbms should return info on the markers. Since Postgres doesn't support that,
243
+ // it is best to say this function is not supported and let the application assume a
244
+ // data type (most likely varchar).
245
245
246
246
RETCODE SQL_API SQLDescribeParam (
247
247
HSTMT hstmt ,
@@ -270,8 +270,8 @@ static char *func = "SQLDescribeParam";
270
270
271
271
ipar -- ;
272
272
273
- /* This implementation is not very good, since it is supposed to describe */
274
- /* parameter markers, not bound parameters. */
273
+ // This implementation is not very good, since it is supposed to describe
274
+ // parameter markers, not bound parameters.
275
275
if (pfSqlType )
276
276
* pfSqlType = stmt -> parameters [ipar ].SQLType ;
277
277
@@ -287,9 +287,9 @@ static char *func = "SQLDescribeParam";
287
287
return SQL_SUCCESS ;
288
288
}
289
289
290
- /* - - - - - - - - - */
290
+ // - - - - - - - - -
291
291
292
- /* Sets multiple values (arrays) for the set of parameter markers. */
292
+ // Sets multiple values (arrays) for the set of parameter markers.
293
293
294
294
RETCODE SQL_API SQLParamOptions (
295
295
HSTMT hstmt ,
@@ -304,15 +304,15 @@ static char *func = "SQLParamOptions";
304
304
return SQL_ERROR ;
305
305
}
306
306
307
- /* - - - - - - - - - */
307
+ // - - - - - - - - -
308
308
309
- /* This function should really talk to the dbms to determine the number of */
310
- /* "parameter markers" (not bound parameters) in the statement. But, since */
311
- /* Postgres doesn't support that, the driver should just count the number of markers */
312
- /* and return that. The reason the driver just can't say this function is unsupported */
313
- /* like it does for SQLDescribeParam is that some applications don't care and try */
314
- /* to call it anyway. */
315
- /* If the statement does not have parameters, it should just return 0. */
309
+ // This function should really talk to the dbms to determine the number of
310
+ // "parameter markers" (not bound parameters) in the statement. But, since
311
+ // Postgres doesn't support that, the driver should just count the number of markers
312
+ // and return that. The reason the driver just can't say this function is unsupported
313
+ // like it does for SQLDescribeParam is that some applications don't care and try
314
+ // to call it anyway.
315
+ // If the statement does not have parameters, it should just return 0.
316
316
RETCODE SQL_API SQLNumParams (
317
317
HSTMT hstmt ,
318
318
SWORD FAR * pcpar )
@@ -338,7 +338,7 @@ static char *func = "SQLNumParams";
338
338
339
339
340
340
if (!stmt -> statement ) {
341
- /* no statement has been allocated */
341
+ // no statement has been allocated
342
342
stmt -> errormsg = "SQLNumParams called with no statement ready." ;
343
343
stmt -> errornumber = STMT_SEQUENCE_ERROR ;
344
344
SC_log_error (func , "" , stmt );
@@ -419,13 +419,13 @@ mylog("%s: entering ... stmt=%u, bindings_allocated=%d, num_columns=%d\n", func,
419
419
stmt -> bindings_allocated = num_columns ;
420
420
421
421
}
422
- /* There is no reason to zero out extra bindings if there are */
423
- /* more than needed. If an app has allocated extra bindings, */
424
- /* let it worry about it by unbinding those columns. */
422
+ // There is no reason to zero out extra bindings if there are
423
+ // more than needed. If an app has allocated extra bindings,
424
+ // let it worry about it by unbinding those columns.
425
425
426
- /* SQLBindCol(1..) ... SQLBindCol(10...) # got 10 bindings */
427
- /* SQLExecDirect(...) # returns 5 cols */
428
- /* SQLExecDirect(...) # returns 10 cols (now OK) */
426
+ // SQLBindCol(1..) ... SQLBindCol(10...) # got 10 bindings
427
+ // SQLExecDirect(...) # returns 5 cols
428
+ // SQLExecDirect(...) # returns 10 cols (now OK)
429
429
430
430
mylog ("exit extend_bindings\n" );
431
431
}
0 commit comments