Subject: | ATTACH database does not work |
Attempting to use the ATTACH command does not work. An error is returned
each time.
Show quoted text
-----------------TEST DATABASE-----------------------------
[/home/tester/scripts/indexer]: sqlite test2.db
SQLite version 2.8.6
Enter ".help" for instructions
sqlite> .tables
sqlite> create table test(t varchar2(200));
sqlite> .tables
test
sqlite>
-----------------TEST SCRIPT-------------------------------
use DBI;
$lite = DBI->connect('DBI:SQLite:test.db',"",""); #open a new db
$sql = "attach database \"test2.db\" as data;"; #attach existing db
$sth=$lite->prepare($sql); #prep statement
#trying to attach the database causes an error
$sth->execute; #STATEMENT FAILS
-----------------ERROR OUTPUT-------------------------------
DBD::SQLite::st execute failed: SQL logic error or missing database at test.pl line 9.