[SQLite3] CREATE TABLE ... doesn't work sometimes


U

Une Bévue

with the following script :
#! /usr/bin/env ruby

begin; require 'rubygems'; rescue LoadError; end

require 'sqlite3'

db = SQLite3::Database.new( 'ou-ou.db' )

db.execute <<SQL
BEGIN TRANSACTION;
CREATE TABLE devicephonebook (
UID INTEGER PRIMARY KEY AUTOINCREMENT,
lastName TEXT NOT NULL DEFAULT(''),
firstName TEXT NOT NULL DEFAULT(''),
fullLastName TEXT
);
COMMIT;
SQL


if, from command line, i do :

$ sqlite3 ou-ou.db
[...]
sqlite> .dump devicephonebook I get :
BEGIN TRANSACTION;
COMMIT;
sqlite>

then, no table created, why ?

i wrote "sometimes" because i've the feeling that if i INSERT something
just afterwards creating the table it's OK ???
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top