Class: OCI8::BindType::Base
- Defined in:
- lib/oci8/bindtype.rb,
ext/oci8/oci8lib.c
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.create(con, val, param, max_array_size) ⇒ Object
12 13 14 |
# File 'lib/oci8/bindtype.rb', line 12 def self.create(con, val, param, max_array_size) self.new(con, val, param, max_array_size) end |
Instance Method Details
#get ⇒ Object
325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'ext/oci8/bind.c', line 325
static VALUE oci8_bind_get(VALUE self)
{
oci8_bind_t *obind = DATA_PTR(self);
const oci8_bind_class_t *obc = (const oci8_bind_class_t *)obind->base.klass;
ub4 idx = obind->curar_idx;
void **null_structp = NULL;
if (NIL_P(obind->tdo)) {
if (obind->u.inds[idx] != 0)
return Qnil;
}
return obc->get(obind, (void*)((size_t)obind->valuep + obind->alloc_sz * idx), null_structp);
}
|
#set(val) ⇒ Object
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'ext/oci8/bind.c', line 358
static VALUE oci8_bind_set(VALUE self, VALUE val)
{
oci8_bind_t *obind = DATA_PTR(self);
const oci8_bind_class_t *obc = (const oci8_bind_class_t *)obind->base.klass;
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;
}
obc->set(obind, (void*)((size_t)obind->valuep + obind->alloc_sz * idx), null_structp, val);
}
return self;
}
|