[oracle@oadb sbin]$ cat insertdb.pl
use DBI;
use HTTP::Date qw(time2iso str2time time2iso time2isoz);
use Net::SMTP;
my $a="测试环境";
print length($a);
print "
";
my $dbName = 'oadb';
my $dbUser = 'query';
my $dbUserPass = 'kjk7787czcb';
my $dbh = DBI->connect("dbi:Oracle:$dbName", $dbUser, $dbUserPass) or die "can't connect to database ";
$dbh->do("insert into tlcb values('$a')");
[oracle@oadb sbin]$ perl insertdb.pl
12
[oracle@oadb sbin]$ cat insertdb.pl
use DBI;
use utf8;
use HTTP::Date qw(time2iso str2time time2iso time2isoz);
use Net::SMTP;
my $a="老干妈";
print length($a);
print "
";
my $dbName = 'oadb';
my $dbUser = 'query';
my $dbUserPass = 'kjk7787czcb';
my $dbh = DBI->connect("dbi:Oracle:$dbName", $dbUser, $dbUserPass) or die "can't connect to database ";
$dbh->do("insert into tlcb values('$a')");
[oracle@oadb sbin]$ perl insertdb.pl
3
[oracle@oadb sbin]$ sqlplus query/kjk7787czcb
SQL*Plus: Release 11.2.0.4.0 Production on 星期六 3月 11 15:06:50 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from tlcb;
NAME
--------------------
测试环境
测试环境
测试环境
测试环境
老干妈