作者carrie0905 (认真的生活)
看板Perl
标题[请益] sql指令SOURCE 的用法
时间Mon Mar 9 20:55:58 2009
小女不才,一直无法de出这个bug,
可不可以麻烦各位高手帮我看看呢?
拜托了!!
==============
这个部分主要是要建一个资料库叫miRBase_130
也的确可以建起来,
接着想要利用 SOURCE这个指令把table.sql这个档案塞入来建此资料库的table
之後再一个档案一个档案塞入各个区域
==============
use DBI;
use DBD::mysql;
use strict;
my $sth = $dbh->prepare("CREATE DATABASE miRBase_130");
$sth->execute();
$sth->finish;
my $sth = $dbh->prepare("USE miRBase_130");
$sth->execute();
my $sth = $dbh->prepare("SOURCE
qq{/home/carrie/ftpdownload/file_new/table.sql}");
$sth->execute();
$sth->finish;
==========
error message如下
DBD::mysql::st execute failed: You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right syntax
to use near 'SOURCE qq{/home/carrie/ftpdownload/file_new/table.sqltable.sql}'
at line 1 at MirMAPs.pl line 74.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.174.13
※ 编辑: carrie0905 来自: 140.112.174.13 (03/09 21:07)