Jump to content

Need recommendation on Database


Trax
 Share

Recommended Posts

2 minutes ago, Trax said:

Local Const $SQLITE_DLL = "C:\SQLite\sqlite3.dll"

that is so you can load your DLL in your PC. Your path. Change C:\SQLite\sqlite3.dll to C:\<your path>\sqlite3.dll in your PC. If you dont have the DLL, you can get it from this site.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Sorry for not mentionning that. Also if you're using x64 (which I don't recommend for now), then the Dll has to be named sqlite3_x64.dll

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

This has been interesting :) @jchd I am pulling things from your snippets to get started and of course am struggling. I did finally manage to get the database and table created. Here is the table statement:"

"CREATE TABLE MeterReadings (Meter INT PRIMARY KEY not null, Date CHAR(10) not null, Time CHAR(8) not null, Reading REAL not null, Error CHAR(1));". via the sqlite3.exe I have verified that the database and table exists. What I haven't been able to do is add records to that table. It keeps throwing an error. Here is the insert command:

insert into MeterReadings values (1,2020/03/06,09:03:57,0,Y)

I know I have some finer point to master, especially storing dates and times, but I am taking baby steps. Any idea why my simple insert command is throwing an error?

 

 

Link to comment
Share on other sites

I'm leaving right now and I'll be back in the (my) evening (Paris time).

Meter isn't a primary key since a PK must be unique. Use the implied rowid or make Id an alias; think of that as a meaningless unique identifier for a row, like a handle of a Windows control or the address of a function.

"CREATE TABLE MeterReadings (Id INT PRIMARY KEY not null, Meter INT, Date CHAR not null default CURRENT_DATE, Time CHAR not null default CURRENT_TIME, Reading REAL not null, Error INT default 0);"

To insert:

insert into MeterReadings (Meter, Reading) values (1, 57.0), (2, 43.5);           (for meters 1 & 2 w/o error)
insert into MeterReadings (Meter, Reading, Error) values (1, 57.0, 0), (3,39.1, 1), (2, 43.4, 0);           (for meters 1, 3 & 2, 3 with error)

This take advantage of the default values.

More later if needed.
 

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...