Once you have the command line client running you can count the rows from a table with this query:
SELECT Count(*) FROM tblName Please change the table name at the end (tblName) On 21 Mar 2017 21:14, "Jonas Augusto" <[email protected]> wrote: You can use the command line client for SQLite: https://www.sqlite. org/cli.html Once it is connected to your database it is simple to make a SQL query. If you don't know how the query​ language works I can help you. Jonas On 21 Mar 2017 21:03, "Michael Christopher Robinson" < [email protected]> wrote: > I'm wondering how to count the number of rows in the database I'm > creating from a C program. The database has a row number or Id that > is the primary key. I need to know how many rows there are to know the > next row number so I can add more temperatures to the database. I'm > developing on a Raspberry Pi 3 Model B 2016. I have six USB > temperature sensors hooked up that I read from in a loop. I generate a > timestamp using time.h and step through the six sensors. Each sensor > has an internal temperature and an external temperature. > > Table is like so: > > id, sensor, timestamp, temp_inner, temp_outer. > > With data types: > > Integer, Integer, Integer, float, float. > > If I can't get a row count in the C program, I have to pass it in every > time I do another round of readings. I'm using sqlite3.h for database > access and manipulation. > > I've been trying to answer this question on my own, but finding sample > C code that does this is not proving to be easy. > _______________________________________________ > PLUG mailing list > [email protected] > http://lists.pdxlinux.org/mailman/listinfo/plug > _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
