sirius wrote:
> Hi,
> I read in the documentation for SQLite that there should be some core
> functions and aggregate functions available, but I can't seem to use
> them in my code.. Can anyone help?
> 
> Here's the documentation i read:
>  http://www.sqlite.org/lang_aggfunc.html
>  http://www.sqlite.org/lang_corefunc.html

Those are functions available to SQL statements executed by SQLite.

> There is for example the function count() but how do I use it?

For example:

SELECT count(*) FROM sometable WHERE column1='somevalue';

The above SQL statement will return a count of the number of rows in
sometable that have a value of 'somevalue' for column1.

> I have tried to use it as stated below, but none of the functions in
> the documentation is available that way (i.e when I type "db." the
> list that shows in Eclipse documentation doesn't include any of the
> functions from the SQLite doc except from execSQL):

SQL is not Java. You can execute SQL statements against SQLite via the
Java rawQuery() method available on SQLiteDatabase.

You are attempting to call SQLite functions as if they were methods on
the SQLiteDatabase object, which generally will not work.

> PS. I haven't worked with databases before, so please keep that in
> mind when you answer me. DS.

I would recommend you learn SQL outside of Android at the outset. If you
specifically want to focus on SQLite, _The Definitive Guide to SQLite_
(Apress) is a good book.

Once you are comfortable with the notion of executing queries to get
results back, possibly including the functions you linked to, then it
will be easier for you to see how to access databases from inside Android.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, $35/Year

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