You put -real- SQL in to those.  ".tables" is a meta-command of sqlite3.

Please, forget about the sqlite3 command, that is only for debugging from
the command line.  You can accomplish everything with the Java API.  You
probably want to get a sqlite3 manual to help you with the command syntax.

On Tue, Dec 1, 2009 at 6:32 AM, dsukhram <[email protected]> wrote:

> When I try to run the '.tables' command by doing the following:
>
> SQLiteDatabase db = this.openOrCreateDatabase(DB_NAME, MODE_PRIVATE,
> null);
> db.execSQL(".tables");
>
> I get this error:
>
> ERROR/Database(13071): Failure 1 (near ".": syntax error) on 0x1f3f60
> when preparing '.tables'.
>
> On Dec 1, 8:14 am, sathya subbiah <[email protected]> wrote:
> > Hi,
> >
> > Use execSQL<
> http://developer.android.com/reference/android/database/sqlite/SQLite..
> .>provided
> > by Android for executing SQL commands.
> >
> >
> >
> > On Tue, Dec 1, 2009 at 7:50 AM, dsukhram <[email protected]> wrote:
> > > Thanks for your reply. But I have looked at this class and I only see
> > > methods for creating,deleting or executing queries on a database. I
> > > don't see any methods for issuing a sqlite command. Maybe i'm blind
> > > but can you point out a method in this class that i would use?
> >
> > > thanks
> >
> > > On Nov 30, 4:04 pm, Dianne Hackborn <[email protected]> wrote:
> > > >http://developer.android.com/reference/android/database/sqlite/SQLite
> ..
> > > .,
> > > > java.lang.Object[])
> >
> > > > On Mon, Nov 30, 2009 at 12:37 PM, dsukhram <[email protected]>
> > > wrote:
> > > > > Well thats the question i'm asking. I've looked at a various
> classes
> > > > > under the android.database.sqlite package but I can't seem to find
> one
> > > > > to do what I want. Can you tell me which one I need to use?
> > > > > On Nov 30, 2:57 pm, Dianne Hackborn <[email protected]> wrote:
> > > > > > Why would you want to do that?  Use the SQLite APIs to execute
> > > whatever
> > > > > > operations you want on the database.
> >
> > > > > > On Mon, Nov 30, 2009 at 11:49 AM, dsukhram <
> [email protected]>
> > > > > wrote:
> > > > > > > When my app loads up I need to import a bunch of records into
> its
> > > > > > > database.
> >
> > > > > > > How do I run the following sqlite3 command from my app?
> >
> > > > > > > sqlite3>.read /data/data/<app>/files/records.sql
> >
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the
> Google
> > > > > > > Groups "Android Developers" group.
> > > > > > > To post to this group, send email to
> > > > > [email protected]
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > [email protected]<android-developers%[email protected]>
> <android-developers%2bunsubs­[email protected]>
> > > <android-developers%[email protected]<android-developers%[email protected]>
> <android-developers%252bu­[email protected]>
> >
> > > > > <android-developers%2bunsubs­[email protected]>
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/android-developers?hl=en
> >
> > > > > > --
> > > > > > Dianne Hackborn
> > > > > > Android framework engineer
> > > > > > [email protected]
> >
> > > > > > Note: please don't send private questions to me, as I don't have
> time
> > > to
> > > > > > provide private support, and so won't reply to such e-mails.  All
> > > such
> > > > > > questions should be posted on public forums, where I and others
> can
> > > see
> > > > > and
> > > > > > answer them.- Hide quoted text -
> >
> > > > > > - Show quoted text -
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "Android Developers" group.
> > > > > To post to this group, send email to
> > > [email protected]
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<android-developers%[email protected]>
> <android-developers%2bunsubs­[email protected]>
> > > <android-developers%[email protected]<android-developers%[email protected]>
> <android-developers%252bu­[email protected]>
> >
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/android-developers?hl=en
> >
> > > > --
> > > > Dianne Hackborn
> > > > Android framework engineer
> > > > [email protected]
> >
> > > > Note: please don't send private questions to me, as I don't have time
> to
> > > > provide private support, and so won't reply to such e-mails.  All
> such
> > > > questions should be posted on public forums, where I and others can
> see
> > > and
> > > > answer them.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%[email protected]>
> <android-developers%2bunsubs­[email protected]>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en- Hide quoted
> text -
> >
> > - Show quoted text -
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to