Class: ODPI::Dpi::Subscr

Inherits:
Object
  • Object
show all
Defined in:
ext/odpi_ext/rbdpi-subscr.c

Defined Under Namespace

Classes: Message

Instance Method Summary collapse

Constructor Details

#initializeObject


41
42
43
44
45
# File 'ext/odpi_ext/rbdpi.c', line 41

VALUE rbdpi_initialize_error(VALUE self)
{
    rb_raise(rb_eRuntimeError, "could not initialize by %s::new", rb_obj_classname(self));
    return Qnil;
}

Instance Method Details

#closeObject


475
476
477
478
479
480
481
482
483
484
485
486
# File 'ext/odpi_ext/rbdpi-subscr.c', line 475

static VALUE subscr_close(VALUE self)
{
    subscr_t *subscr = rbdpi_to_subscr(self);

    CHK(dpiSubscr_close(subscr->handle));
    if (subscr->callback_ctx != NULL) {
        subscr_callback_ctx_set_close(subscr->callback_ctx);
        subscr_callback_ctx_unref(subscr->callback_ctx);
        subscr->callback_ctx = NULL;
    }
    return self;
}

#initialize_copy(other) ⇒ Object


461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'ext/odpi_ext/rbdpi-subscr.c', line 461

static VALUE subscr_initialize_copy(VALUE self, VALUE other)
{
    subscr_t *subscr = rbdpi_to_subscr(self);

    *subscr = *rbdpi_to_subscr(other);
    if (subscr->callback_ctx != NULL) {
        subscr_callback_ctx_ref(subscr->callback_ctx);
    }
    if (subscr->handle != NULL) {
        CHK(dpiSubscr_addRef(subscr->handle));
    }
    return self;
}

#prepare_stmt(sql) ⇒ Object


488
489
490
491
492
493
494
495
496
497
# File 'ext/odpi_ext/rbdpi-subscr.c', line 488

static VALUE subscr_prepare_stmt(VALUE self, VALUE sql)
{
    subscr_t *subscr = rbdpi_to_subscr(self);
    dpiStmt *stmt;

    CHK_STR_ENC(sql, subscr->enc.enc);
    CHK(dpiSubscr_prepareStmt(subscr->handle, RSTRING_PTR(sql), RSTRING_LEN(sql), &stmt));
    RB_GC_GUARD(sql);
    return rbdpi_from_stmt(stmt, &subscr->enc);
}