DBD-cego
view release on metacpan or search on metacpan
void
disconnect(dbh)
SV * dbh
CODE:
D_imp_dbh(dbh);
if ( !DBIc_ACTIVE(imp_dbh) ) {
XSRETURN_YES;
}
/* Check for disconnect() being called whilst refs to cursors */
/* still exists. This possibly needs some more thought. */
if (DBIc_ACTIVE_KIDS(imp_dbh) && DBIc_WARN(imp_dbh) && !PL_dirty) {
STRLEN lna;
char *plural = (DBIc_ACTIVE_KIDS(imp_dbh)==1) ? (char*)"" : (char*)"s";
warn("%s->disconnect invalidates %d active statement handle%s %s",
SvPV(dbh,lna), (int)DBIc_ACTIVE_KIDS(imp_dbh), plural,
"(either destroy statement handles or call finish on them before disconnecting)");
}
ST(0) = dbd_db_disconnect(dbh, imp_dbh) ? &PL_sv_yes : &PL_sv_no;
DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
t/07create_proc.t view on Meta::CPAN
$sth = $dbh->do("create procedure copytab ( copyCond in int ) return int
begin
var copyCount int;
:copyCount = 0;
var ca int;
var cb string(30);
cursor copyCursor as select a, b from srctab where a = :copyCond;
while fetch copyCursor into ( :ca, :cb ) = true
begin
insert into desttab values ( :ca, :cb );
:copyCount = :copyCount + 1 ;
end;
return :copyCount;
end;");
( run in 0.876 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )