Class: OCI8::BindType::Base
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.create(con, val, param, max_array_size) ⇒ Object
13
14
15
|
# File 'lib/oci8/bindtype.rb', line 13
def self.create(con, val, param, max_array_size)
self.new(con, val, param, max_array_size)
end
|
Instance Method Details
260
261
262
263
264
265
266
267
268
269
270
271
272
|
# File 'ext/oci8/bind.c', line 260
static VALUE oci8_bind_get(VALUE self)
{
oci8_bind_t *obind = TO_BIND(self);
const oci8_bind_data_type_t *data_type = (const oci8_bind_data_type_t *)obind->base.data_type;
ub4 idx = obind->curar_idx;
void **null_structp = NULL;
if (NIL_P(obind->tdo)) {
if (obind->u.inds[idx] != 0)
return Qnil;
}
return data_type->get(obind, (void*)((size_t)obind->valuep + obind->alloc_sz * idx), null_structp);
}
|
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
|
# File 'ext/oci8/bind.c', line 293
static VALUE oci8_bind_set(VALUE self, VALUE val)
{
oci8_bind_t *obind = TO_BIND(self);
const oci8_bind_data_type_t *data_type = (const oci8_bind_data_type_t *)obind->base.data_type;
ub4 idx = obind->curar_idx;
if (NIL_P(val)) {
if (NIL_P(obind->tdo)) {
obind->u.inds[idx] = -1;
} else {
*(OCIInd*)obind->u.null_structs[idx] = -1;
}
} else {
void **null_structp = NULL;
if (NIL_P(obind->tdo)) {
null_structp = NULL;
obind->u.inds[idx] = 0;
} else {
null_structp = &obind->u.null_structs[idx];
*(OCIInd*)obind->u.null_structs[idx] = 0;
}
data_type->set(obind, (void*)((size_t)obind->valuep + obind->alloc_sz * idx), null_structp, val);
}
return self;
}
|