Sqlite table question

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Sqlite table question

  • Creator
    Topic
  • #51745
    Mike Campbell
    Participant

      We have Cloverleaf 5.7 running on AIX.

      I’m trying to create a simple 2 column table via the command line.

      I create the table, create the columns with definitions, and insert a couple of rows.  When I query the table, all looks good.

      I exit sqlite.  When I restart a session, the table is not there!  

      So, what step am I missing??

      create table main.FNB_MRN (fnb_cust_num varchar(15), nmh_mrn_num varchar(9));

      sqlite> insert into main.FNB_MRN (‘1234567′,’876543’);

      sqlite> insert into main.FNB_MRN values (‘2345678′,’987654’);

      sqlite> select * from main.FNB_MRN;

      1234567|876543

      2345678|987654

      …after I restart an sqlite session:

      select * from main.FNB_MRN;

      SQL error: no such table: main.FNB_MRN  

    Viewing 1 reply thread
    • Author
      Replies
      • #71554
        John Mercogliano
        Participant

          Mike,

           When you start sqlite are you starting it up with the database name as an argument?  Being you appear to want you database to be called main you should be starting it up as

          Code:

          sqlite3 main

           If you have not been passing a name on the command line then a temporary database is getting created and deleted when you exit sqlite.

          John Mercogliano
          Semi Retired, contractor
          Hampton Roads, VA

        • #71555
          Mike Campbell
          Participant

            Thanks John.

            I knew it had to be something simple.  I wasn’t aware of qualifying the initial connection with the ‘main’.  

            Its working as expected now.

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.