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

Discussion in 'Ruby' started by Une Bévue, Oct 14, 2007.

  1. Une Bévue

    Une Bévue Guest

    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
     
    Une Bévue, Oct 14, 2007
    #1
    1. Advertising

  2. Une Bévue

    Une Bévue Guest

    Une Bévue, Oct 14, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Saunders
    Replies:
    0
    Views:
    488
    John Saunders
    Aug 28, 2003
  2. Randy Smith
    Replies:
    2
    Views:
    478
    Randy Smith
    Apr 24, 2007
  3. Stef Mientki
    Replies:
    0
    Views:
    230
    Stef Mientki
    Oct 18, 2008
  4. paul reed

    Custom Control Width sometimes has a value...sometimes doesn't

    paul reed, Feb 17, 2004, in forum: ASP .Net Building Controls
    Replies:
    8
    Views:
    157
    Jeffrey Tan[MSFT]
    Feb 21, 2004
  5. Jesse Schoch
    Replies:
    2
    Views:
    147
    Jesse Schoch
    Oct 2, 2003
Loading...

Share This Page