DBD-DBMaker
view release on metacpan or search on metacpan
if (DBIc_ACTIVE_KIDS(imp_dbh) && DBIc_WARN(imp_dbh) && !dirty) {
warn("disconnect(%s) invalidates %d active cursor(s)",
SvPV(dbh,na), (int)DBIc_ACTIVE_KIDS(imp_dbh));
}
ST(0) = dbd_db_disconnect(dbh) ? &sv_yes : &sv_no;
void
DESTROY(dbh)
SV * dbh
PPCODE:
D_imp_dbh(dbh);
ST(0) = &sv_yes;
if (!DBIc_IMPSET(imp_dbh)) { /* was never fully set up */
if (DBIc_WARN(imp_dbh) && !dirty && dbis->debug >= 2)
warn("Database handle %s DESTROY ignored - never set up",
SvPV(dbh,na));
}
else {
if (DBIc_IADESTROY(imp_dbh)) { /* want's ineffective destroy */
DBIc_ACTIVE_off(imp_dbh);
CODE:
ST(0) = dbmaker_get_foreign_keys(dbh, sth, PK_CatalogName, PK_SchemaName, PK_TableName, FK_CatalogName, FK_SchemaName, FK_TableName) ? &sv_yes : &sv_no;
#
# Corresponds to ODBC 2.0. 3.0's SQL_API_ODBC3_ALL_FUNCTIONS will break this
# scheme
void
_GetFunctions(dbh, func)
SV * dbh
int func
PPCODE:
UWORD pfExists[100];
RETCODE rc;
int i;
D_imp_dbh(dbh);
rc = SQLGetFunctions(imp_dbh->hdbc, func, pfExists);
if (SQL_ok(rc)) {
if (func == SQL_API_ALL_FUNCTIONS) {
for (i = 0; (i < sizeof(pfExists)/sizeof(pfExists[0])); i++) {
XPUSHs(pfExists[i] ? &sv_yes : &sv_no);
}
fetch(sth)
SV * sth
CODE:
AV *av = dbd_st_fetch(sth);
ST(0) = (av) ? sv_2mortal(newRV((SV *)av)) : &sv_undef;
void
fetchrow(sth)
SV * sth
PPCODE:
D_imp_sth(sth);
AV *av;
if (DBIc_COMPAT(imp_sth) && GIMME == G_SCALAR) { /* XXX Oraperl */
/* This non-standard behaviour added only to increase the */
/* performance of the oraperl emulation layer (Oraperl.pm) */
if (!imp_sth->done_desc && !dbd_describe(sth, imp_sth))
XSRETURN_UNDEF;
XSRETURN_IV(DBIc_NUM_FIELDS(imp_sth));
}
av = dbd_st_fetch(sth);
if (!DBIc_ACTIVE(imp_sth)) {
/* No active statement to finish */
XSRETURN_YES;
}
ST(0) = dbd_st_finish(sth) ? &sv_yes : &sv_no;
void
DESTROY(sth)
SV * sth
PPCODE:
D_imp_sth(sth);
ST(0) = &sv_yes;
if (!DBIc_IMPSET(imp_sth)) { /* was never fully set up */
if (DBIc_WARN(imp_sth) && !dirty && dbis->debug >= 2)
warn("Statement handle %s DESTROY ignored - never set up",
SvPV(sth,na));
}
else {
if (DBIc_IADESTROY(imp_sth)) { /* want's ineffective destroy */
DBIc_ACTIVE_off(imp_sth);
char * file_prefix
int fgOverwrite
CODE:
ST(0) = dbmaker_bind_col_to_file(sth, colno, file_prefix,fgOverwrite) ? &sv_yes : &sv_no;
void
DescribeCol(sth, colno)
SV *sth
int colno
PPCODE:
char ColumnName[SQL_MAX_COLUMN_NAME_LEN];
I16 NameLength;
I16 DataType;
U32 ColumnSize;
I16 DecimalDigits;
I16 Nullable;
int rc;
rc = dbmaker_describe_col(sth, colno, ColumnName, sizeof(ColumnName), &NameLength,
( run in 1.409 second using v1.01-cache-2.11-cpan-71847e10f99 )