perl如何执行DDL语句

perl如何执行DDL语句



[Copy to clipboard] [ - ]
CODE:
use DBI;

my $dbname="mydb";
my $dbuser="user";
my $dbpwd="pwd";
my $dbh="";
         $dbh = DBI->connect("dbi:Oracle:$dbname",$dbuser,$dbpwd) || die "与数据库建立连接失败!\n错误信息:" . DBI-errstr;
my $sql="select * from teststr;";

my $sth = $dbh->prepare($sql);
$sth->execute();

我用上面的代码连接oracle,
如果我想做DDL操作时候,请教高手,应该如何实现,比如,我想执行 "DESC TESTSTR;"
use DBI;

my $dbname="mydb";
my $dbuser="user";
my $dbpwd="pwd";
my $dbh="";
         $dbh = DBI->connect("dbi:Oracledbname",$dbuser,$dbpwd) || die "与数据库建立连接失败!\n错误信息:" . DBI-errstr;
my $sql="insert into ....values()";

my $sth = $dbh->prepare($sql);
$sth->execute();