Class: OCIDescribe

Inherits:
OCIHandle show all
Defined in:
ext/oci8/oci8.c

Instance Method Summary collapse

Methods inherited from OCIHandle

#attrGet, #attrSet, #free, new

Instance Method Details

#describeAny(vdsc, vname, vtype) ⇒ Object

begin

— OCIDescribe#describeAny(svc, name, type)

    get various information of Oracle's schema objects: tables, views, synonyms,
    procedures, functions, packages, sequences, and types.

    :svc
       ((<service context handle|OCISvcCtx>)) in which the object to describe exists.
    :name
       name of object to describe.
    :type
       type of object to describe.

((|OCI_PTYPE_TABLE|)), for tables
((|OCI_PTYPE_VIEW|)), for views
((|OCI_PTYPE_PROC|)), for procedures
((|OCI_PTYPE_FUNC|)), for functions
((|OCI_PTYPE_PKG|)), for packages
((|OCI_PTYPE_TYPE|)), for types
((|OCI_PTYPE_SYN|)), for synonyms
((|OCI_PTYPE_SEQ|)), for sequences
((|OCI_PTYPE_SCHEMA|)), for schemas
((|OCI_PTYPE_DATABASE|)), for databases
((|OCI_PTYPE_UNK|)), for unknown schema objects

    correspond native OCI function: ((|OCIDescribeAny|))

    ((*note*)): To use this method in Oracle 8.0.5 for Linux,
    call OCIEnv.create with OCI_OBJECT or segmentation fault occurs.
    This bug was fixed 8.0.6 or later.

end



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'ext/oci8/describe.c', line 58

static VALUE oci8_describe_any(VALUE self, VALUE vdsc, VALUE vname, VALUE vtype)
{
  oci8_handle_t *h;
  oci8_handle_t *svch;
  oci8_string_t name;
  ub1 type;
  sword rv;

  Get_Handle(self, h); /* 0 */
  Check_Handle(vdsc, OCISvcCtx, svch); /* 1 */
  Get_String(vname, name); /* 2 */
  type = FIX2INT(vtype); /* 3 */

  rv = OCIDescribeAny(svch->hp, h->errhp, name.ptr, name.len, OCI_OTYPE_NAME, OCI_DEFAULT, type, h->hp);
  if (rv != OCI_SUCCESS) {
    oci8_raise(h->errhp, rv, NULL);
  }
  return self;
}