SQLite User Forum

passing date to/from table
Login

passing date to/from table

(1) By john sowden (jsowden) on 2022-10-20 05:06:22 [link] [source]

I've been using foxpro/dos for decades. I am trying to switch to pure basic sqlite. in examples, I have not seen how to read data from a record into a variable and vice versa.

help?

(2) By Gunter Hick (gunter_hick) on 2022-10-20 05:51:56 in reply to 1 [source]

I am guessing that you are asking about the following.

Using this statement as a pattern:

SELECT a,b,c FROM t WHERE a = :a;

Call one of the sqlite3_prepare() functions to prepare the statement.
Call the sqlite3_bind() family of functions to set the value of the :a variable.
Call sqlite3_step() to produce a row of the result set.
Call the sqlite3_value() family of functions to retrieve the field values.
Repeat the last two steps until SQLITE_DONE is returned.
Call sqlite3_reset() if you want to execute the statement again (starting from the bind step to set new parameters)
Call sqlite3_finalize() when you are done using the statement.

(3) By john sowden (jsowden) on 2022-10-20 06:32:07 in reply to 2 [link] [source]

wow thats a lot to read data from a selected record to a set of variables, in foxpro it tales 1 line. I hope I am missing something.

John

(4) By Chris Locke (chrisjlocke1) on 2022-10-20 06:48:39 in reply to 3 [link] [source]

Whats the language you're using to read the data using SQLite? I use VB .Net, so to read a record, is one line. In the background, a wrapper does all the 'other fluffy stuff'. You using FoxPro is the same ... it's one line which runs another line, which runs a function, which does the stuff.