> -----Original Message-----
> From: Rahul Banerjee [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 27, 2007 1:34 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] Extremely new to SQLite
> 
> Hi,
> I'm trying to integrate SQLite into a library management system coded
in
> C++. I'm extremely new to SQLite and the documentation at
> http://www.sqlite.org didn't do it for me.
> Can anyone give me some help/tips.
> All I need to do is:
> 1. Access db

See the docs on sqlite3_open() for getting a handle to a database.

> 2. Retrieve data from a particular row and column (and store it into a
> var)

I'd recommend using sqlite3_prepare_v2 to prepare the statement, the
various sqlite3_bind_*() functions to bind variables, and then
sqlite3_step() to execute it.  You'll prepare something lke "select col1
from table2 where col2=:1" (or one of various placeholder syntaxes
supported by SQLite3).  Obviously you'll need some understanding of SQL
in general, which is largely not specific to SQLite.

> 3. Write/Modify data into db

Pretty much the same as selecting data, but with different SQL.

> 4. Save and exit db

You don't "save"; you "commit;" your transaction, if you started one.
If you didn't start one explicitly, there's nothing to do; the library
will commit after each statement.  That's the joy of Durability in ACID.

-- James


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to