Help with SQLite

Started by oradba4u, September 18, 2020, 12:17:54 PM

Previous topic - Next topic

oradba4u

I'm really trying to get a handle on this SQLite stuff.

When I run some demo code that I got off this site, I get the following error:

"Extender DLL is invalid"

I am using the wbsql44i.dll with the chinook demo database

Code (winbatch) Select
; SQLite usage Demo...

AddExtender("wbsql44i.dll")

; All my code AND the db are in the same directory for ease of understanding???
db = DirScript():"chinook.db" ;INCLUDE FULL PATH FOR DATABASE

SQLText = "SELECT * from customers"

stmt = dbGetRows(db,SQLText,@TRUE,600)
Message("dbGetRows()","Rows: ":ArrInfo(stmt,1):@CRLF:"Columns: ":ArrInfo(stmt,2))

dim = ArraySearch (stmt, "*EOF*", 0, 0) ;Read up on Search Types

If dim > -1 Then ArrayRedim(stmt, dim, -1)

;ArrayFilePutCsv ("array.txt", stmt)
;Message("dbGetRows()",FileGet("array.txt"))
;FileDelete("array.txt")


Also, how can I create my own SQLite database from an existing set of tables in MySQL (for example)? I'll check out "importing SQLite CSV...

JTaylor

To eliminate any questions about what version you have, please use this one and see if you get the same error.

   http://www.jtdata.com/anonymous/wbsql44i_vr.zip

Jim

JTaylor

The SQLite site and related resources are the best places for info on how to handle SQLite tasks regarding table creation and manipulation.   The Extender obviously has its own specific Syntax for the functions but it is simply a wrapper for SQLite.   

Also, there is no direct way to import from one database to another via this Extender.  You will need to export into a delimited format or use WinBatch to retrieve the data and then do an insert into the SQLite database or some variation.   It isn't complicated.   Just need to figure out which variation works best for your situation.

    https://www.sqlite.org/index.html

Jim

oradba4u

Thanks for the info.

I downloaded the referenced file, unzipped it, re-compiled my program, and got the same result... Extender DLL Invalid
Then i compiled with 32-bit compiler and VOILA! Working like a champ. See the rookie mistakes?

JTaylor

That was going to be my next suggestion.  Actually started to make that earlier.

jim