On Wed, 4 Sep 2013 10:57:44 +0530, Pratheek Prakash
<prathe...@tataelxsi.co.in> wrote:


> Hi Kees Nuyt,
> 
> That was really helpful. Also I have another doubt.
> Eventually I will be running sqlite integrated with other
> modules in a board. 

That is what SQLite is made for.

> As far as I have read I suppose that sqlite treats
> a database as a file. 

Yes, a SQLite database is a file. SQLite will also creaste
journal files (in the same directory as the database) and
possibly temporary files (elsewhere in the filesystem).

> Adding data to the database and retrieving data from the
> database is equivalent to write() and read() file
> operations. But in board where can I create that database
> file like creating one in computer? Is it possible? 

Creating a database is as simple as opening it, and
creating one or more tables using SQL statements.
In principle you only have to implement a VFS to port
SQLite to a new platform, the VFS is so to speak the
operating system abstraction layer (See my previous message).
The VFSses for Windows and POSIX (Unix and the like) are 
included in the source tree, some other people may have 
implemented VFSses for other operating systems.

As far as SQLite is concerned, a C program using SQLite will
be the same on any operating system, and the database file
itself is portable between all platforms.

> Also for communicating with the sqlite library do I need
> to use command line interface always? 

No, the command line interface is a reference
implementations and development tool. It can also be used
productively from shell scripts.

> Because in board its
> not possible. Can I call those library functions directly
> from the application?

SQLite is an embedded SQL database library. Typically it
is used via the C API, or by using a wrapper for other
languages. Canonical program structure:

Program init
        sqlite3_open_v2()
        sqlite3_prepare_v2()

Statement execution
        loop
                sqlite3_bind_*()
                sqlite3_step()
                sqlite3_column_*()
        end loop
        sqlite3_reset()

Program exit
        sqlite3_finalize()
        sqlite3_close()

Please note that some of these entry points have a _v2()
version, which is the preferred version.
Please read the docs of each of those API entry points
carefully, and don't forget to check the status after each
and every call.


> It will be really helpful if you can provide me with some
> inputs on these

You'll have to read more of the documentation, and experiment.

Here are a few more pointers:

http://sqlite.org/docs.html

http://sqlite.org/c3ref/intro.html
http://sqlite.org/cintro.html

http://sqlite.org/arch.html

Coding examples:
http://icculus.org/~chunky/stuff/sqlite3_example/

Last but not least: The hint of Donald Griggs of about
a day ago is very valuable!


-- 
Groet, Cordialement, Pozdrawiam, Regards,

Kees Nuyt

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to