在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.目录 1.1 Perl模块安装
安装好了 需要用Perl命令调一下
1.2 使用集成的工具进行开发
国外的优秀软件可以写 perl,python,ruby 等等是集成的工具
调用相关的命令
输出打印的信息
中文的相关设置
C:\Perl64\site\bin;C:\Perl64\bin;C:\app\Administrator\product\11.2.0\dbhome_2\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Oracle\Instant Client\bin
环境相关变量
下面是测试程序 #!/usr/bin/perl -w use strict; use warnings; use DBI;
my $dbname="orcl"; my $user="huangxin"; my $passwd="qq123456"; my $dbh=""; #$dbh = DBI->connect('dbi:Oracle:',q{system/[email protected](DESCRIPTION = # (ADDRESS = (PROTOCOL = TCP)(HOST = WCNXL186023-5HH)(PORT = 1521)) # (CONNECT_DATA = # (SERVER = DEDICATED) # (SERVICE_NAME = orcl.TD.TERADATA.COM) # )},""); $dbh=DBI->connect("dbi:Oracle:localhost/orcl",$user,$passwd) or die "can't connect to database ". DBI->errstr; # my $sth=$dbh->prepare("select * from emp"); $sth->execute;
while (my @recs=$sth->fetchrow_array) { print $recs[0].":".$recs[1]."\n"; } $dbh->disconnect;
成功部分的截屏 |
请发表评论