DBD-Informix4

 view release on metacpan or  search on metacpan

dbdimp.c  view on Meta::CPAN


dbistate_t *dbis;

static SV *dbd_pad_empty;

static char* gDatabase;

#define MAXCURS 5
static _SQCURSOR _SQ[MAXCURS];
static struct sqlda *udesc[MAXCURS];
static int cursbusy[MAXCURS] = {0,0,0,0,0};

void
dbd_init(dbistate)
    dbistate_t *dbistate;
{
    DBIS = dbistate;
    sqlca.sqlcode = 0;
    if (getenv("DBD_PAD_EMPTY"))
	sv_setiv(dbd_pad_empty, atoi(getenv("DBD_PAD_EMPTY")));
}

dbdimp.c  view on Meta::CPAN

  int i, pos;
  char* cp;
  struct sqlvar_struct *col;
  int ret = -2;
  SV** svp = hv_fetch((HV *)SvRV(sth), "Statement", 9, FALSE);
  char *statement = SvPV(*svp, na);
#if I4DEBUG
  fprintf(stderr, "dbd_st_execute\n");
#endif
  for (i = 0; i < MAXCURS; i++)
    if (!cursbusy[i])
      {
	cursbusy[i] = 1;
	imp_sth->index = i;
	break;
      }
  _iqprepare(&_SQ[imp_sth->index], statement);
  if (sqlca.sqlcode != 0)
    return dbd_error(sth, sqlca.sqlcode);
  _iqdscribe(&_SQ[imp_sth->index], &udesc[imp_sth->index]);
  if (sqlca.sqlcode != 0)
    return dbd_error(sth, sqlca.sqlcode);
#if I4DEBUG

dbdimp.c  view on Meta::CPAN



int
dbd_st_finish(sth, imp_sth)
    SV *sth;
    struct imp_sth_st* imp_sth;
{
#if I4DEBUG
  fprintf(stderr, "dbd_st_finish\n");
#endif
  if (cursbusy[imp_sth->index])
    {
      cursbusy[imp_sth->index] = 0;
      _iqclose(_SQ[imp_sth->index]);
      imp_sth->execd = 0;
    }
  DBIc_ACTIVE_off(imp_sth);
  return 1;
}


void
dbd_st_destroy(sth, imp_sth)



( run in 0.265 second using v1.01-cache-2.11-cpan-87723dcf8b7 )