WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: oradba4u on September 18, 2020, 12:17:54 PM

Title: Help with SQLite
Post by: oradba4u on September 18, 2020, 12:17:54 PM
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...
Title: Re: Help with SQLite
Post by: JTaylor on September 18, 2020, 12:46:57 PM
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
Title: Re: Help with SQLite
Post by: JTaylor on September 18, 2020, 12:57:05 PM
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
Title: Re: Help with SQLite
Post by: oradba4u on September 18, 2020, 02:17:38 PM
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?
Title: Re: Help with SQLite
Post by: JTaylor on September 18, 2020, 03:05:36 PM
That was going to be my next suggestion.  Actually started to make that earlier.

jim