Class: OCIFileLocator

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

Instance Method Summary collapse

Methods inherited from OCILobLocator

#char_width=, #clone, #close, #create_temporary, #getChunkSize, #getLength, #is_initialized?, #open, #read, #trim, #write

Methods inherited from OCIDescriptor

#attrGet, #attrSet, #free, new

Instance Method Details

#exists?(vsvc) ⇒ Boolean

Returns:

  • (Boolean)


316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'ext/oci8/lob.c', line 316

static VALUE oci8_lobfile_exist_p(VALUE self, VALUE vsvc)
{
  oci8_handle_t *h;
  oci8_handle_t *svch;
  boolean flag;
  sword rv;

  Get_Handle(self, h); /* 0 */
  Check_Handle(vsvc, OCISvcCtx, svch); /* 1 */

  rv = OCILobFileExists(svch->hp, h->errhp, h->hp, &flag);
  if (rv != OCI_SUCCESS)
    oci8_raise(h->errhp, rv, NULL);
  return flag ? Qtrue : Qfalse;
}

#name(venv) ⇒ Object



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'ext/oci8/lob.c', line 278

static VALUE oci8_lobfile_name(VALUE self, VALUE venv)
{
  oci8_handle_t *h;
  oci8_handle_t *envh;
  char dir_alias[31];
  ub2 d_length = sizeof(dir_alias);
  char filename[256];
  ub2 f_length = sizeof(filename);
  sword rv;

  Get_Handle(self, h); /* 0 */
  Check_Handle(venv, OCIEnv, envh); /* 1 */

  rv = OCILobFileGetName(envh->hp, h->errhp, h->hp, (OraText*)dir_alias, &d_length, (OraText*)filename, &f_length);
  if (rv != OCI_SUCCESS)
    oci8_raise(h->errhp, rv, NULL);
  return rb_ary_new3(2, rb_str_new(dir_alias, d_length), rb_str_new(filename, f_length));
}

#set_name(venv, vdir, vfile) ⇒ Object



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'ext/oci8/lob.c', line 297

static VALUE oci8_lobfile_set_name(VALUE self, VALUE venv, VALUE vdir, VALUE vfile)
{
  oci8_handle_t *h;
  oci8_handle_t *envh;
  sword rv;

  Get_Handle(self, h); /* 0 */
  Check_Handle(venv, OCIEnv, envh); /* 1 */
  StringValue(vdir); /* 2 */
  StringValue(vfile); /* 3 */

  rv = OCILobFileSetName(envh->hp, h->errhp, (OCILobLocator **)&h->hp,
			 RSTRING_ORATEXT(vdir), RSTRING_LEN(vdir),
			 RSTRING_ORATEXT(vfile), RSTRING_LEN(vfile));
  if (rv != OCI_SUCCESS)
    oci8_raise(h->errhp, rv, NULL);
  return self;
}