[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

unbewusst.sein

10/14/2007 10:21:00 AM


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 ???

--
Une Bévue
1 Answer

unbewusst.sein

10/14/2007 11:38:00 AM

0

Arlen Christian Mart Cuss <celtic@sairyx.org> wrote:

> Ideally, to do transactions, you should use the db.transaction method;
>
> http://sqlite-ruby.rubyforge.org/sqlite3/faq.html...

OK, fine thanks !

--
Une Bévue