[請益] sql指令SOURCE 的用法

看板Perl作者 (認真的生活)時間16年前 (2009/03/09 20:55), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
小女不才,一直無法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)
文章代碼(AID): #19jH7Vkw (Perl)
討論串 (同標題文章)
文章代碼(AID): #19jH7Vkw (Perl)