PERL,执行ORACLE存储过程.
时间:2007-09-18 来源:hello386
本内容来自:http://beckheng.itpub.net/post/7469/231237
$dbh->do("
BEGIN
procName;
END;
");
多谢 beckheng 和 Justin
#一下是个例子
use DBI;
$dbname="XXTDB"; #数据库名称
$user="scott"; #用户名
$passwd="xxt"; #密码
$dbh="";
print "------------------------------------------\n";
print " by kuaidao \n";
print " e-mail: maxiaodou at 126.com \n";
print "------------------------------------------\n";
print "connect the db $dbname.....\n";
#连接数据库
$dbh = DBI->connect("dbi:Oracle:$dbname",$user,$passwd) or die "can't connect todatabase ". DBI-errstr;
#开始执行存储过程 REP_MAP
$dbh->do("
BEGIN
REP_MAP;
END;
");
$dbh->disconnect;
print " ok DB disconnect\n"
$dbh->do("
BEGIN
procName;
END;
");
多谢 beckheng 和 Justin
#一下是个例子
use DBI;
$dbname="XXTDB"; #数据库名称
$user="scott"; #用户名
$passwd="xxt"; #密码
$dbh="";
print "------------------------------------------\n";
print " by kuaidao \n";
print " e-mail: maxiaodou at 126.com \n";
print "------------------------------------------\n";
print "connect the db $dbname.....\n";
#连接数据库
$dbh = DBI->connect("dbi:Oracle:$dbname",$user,$passwd) or die "can't connect todatabase ". DBI-errstr;
#开始执行存储过程 REP_MAP
$dbh->do("
BEGIN
REP_MAP;
END;
");
$dbh->disconnect;
print " ok DB disconnect\n"
相关阅读 更多 +
排行榜 更多 +