tags:

views:

21

answers:

1

Hi guys, i have problem with sqlite3 shell prompt i.e I have created 2 tables called table1 and table2 in sqlite3 shell prompt and also i have imported table1.dat and table2.dat in table1,table2 respectively.If i close the sqlite3 window and open it again it is not showing tables it is giving error as "no such table".

Is there any solution for this? do i need to use any command like "commit" so that if i reopen the sqlite3 prompt it will show my tables.

Plz.. help me.

thanks in advance for ur valuable answers.

A: 

You should enter a database name on the command line that starts sqlite, for example:

sqlite3 my_database.db

When you use the same database name the second time you run sqlite you should see your tables.

Doug Currie
thank you for taking time to help others.But still it is creating problem.As Im new to android and sqlite can u help me how to create database in sqlite prompt.there are two databases they are main and temp I have used your command but it is not working.Can u help me plz...thanks in advance for ur answers.
john
@john, When you say "it is not working," what specifically happens? Is the file created? Do you get any error messages? Is the directory in which you are creating the file owned by you? Is it writable?
Doug Currie
Hi,I have created 2 tables as follows(for example)sqlite> create table table1(_id integer,ename text);sqlite> create table table2(_id integer,Deptname text);sqlite> .tablestable1 table2Now 2 table are created and imported some .dat files in table1 n table2.It has imported and wen i use "select * from table1;" it is showing all data.And im closing the window now.When I reopen the window and using the command assqlite>.tablesIt is not showing my tables which I have created.This is the problem.I want to get back my tables and data.can u help me plz..as Im new to androidthanks.....
john
@john, you seem to have missed the point. What command do you use to start sqlite? That command contains the database name. If you do not provide one, then the database is created in memory and destroyed when you quit sqlite. If you did provide one, then while sqlite is still running, see if the file is created in the filesystem as expected.
Doug Currie