Example Code

SQLite database toolkit (Windows)

Code and Documents

Attachment

Download All

SQLite WRAPPER for LabVIEW was written to gain access to use sqlite3-based databases from the LabVIEW development environment. By using a (very) simple API (open/exec/close) and a simple yet powerfull access to query results (without limitations to memorysize) everybody can benefit from the beautiful world of databases.

LabVIEW 7.1.1

SQLite 3.3.6

SQLite WRAPPER for LabVIEW was written to gain access to use sqlite3-based databases from the LabVIEW development environment. By using a (very) simple API (open/exec/close) and a simple yet powerfull access to query results (without limitations to memorysize) everybody can benefit from the beautiful world of databases. You need to be knowledgeable of the SQL-query language. Remember that SQLite uses a subset (or dialect) of other SQL-implementations, read the documentation !http://decibel.ni.com/content/docs/DOC-1254/!

Martin Vernhout

Philips Research

Change control:

v1.0.1, bundle for LabVIEW 7.1.1 including LabVIEW 7 (on special request, but untested)this release adds some functionaly, protection of the database references. most of API is now set for reentrant execution...

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
BetaCommunityCo
Member
Member
on

Performance: SQLite vs MS Access

I did a quick LabVIEW benchmark test comparing SQLite and MS Access, and SQLite was way faster!

Here are the results:

1. Inserting 10000 records (5 columns) of text:

MS Access: 26494 ms (MDB file size: 1,124 KB)

SQLite: 1446 ms (DB file size: 262 KB)

<ol>

<li> Querying 10000 records from 1 table:

MS Access: 10103 ms

SQLite: 227 ms</li>

</ol>

Thanks for sharing this Martin!

BetaCommunityCo
Member
Member
on

Great Post

I can definitely find a use for this - thanks for sharing this

BetaCommunityCo
Member
Member
on

Nice work !!

Thanks to share it !

BetaCommunityCo
Member
Member
on

SQL toolkit

cool~~,

It is useful!

vernhout
Member
Member
on

from the author

"project under internal review... needed to revoke toolkit from public site..."

RanWeiss
Member
Member
on

Ooops, where is the code?

Mads
Active Participant
Active Participant
on

If you do multiple writes in a single transaction it is quick, however a single insert of one string takes 80-100 ms. That seems extremely slow, is there a way to speed that up?

fredcm1
Member
Member
on

How can I make a download?:

fredcm1
Member
Member
on

how can you made the download?

fredcm1
Member
Member
on

where are the vi's? i would like to use this vi's in my labview... could you send to me, please?

8Rino
Member
Member
on

I'm interested in testing one my application working with MySQL with SQLite: is it possible to get your toolkit? Thanks,

Rino

ChrisAlf
Member
Member
on

I need this also, where did it go??

8Rino
Member
Member
on

Hello Chris and all,

I found alternate solutions to work with SQLite in LV: you can use ODBC driver by Christian Werner downloadable from http://www.ch-werner.de/sqliteodbc/ or DLL-based direct access from Chris Davis at http://lavag.org/topic/2831-sqlite-and-labview/page__p__13361&#entry13361 (look into the messages for code in .ZIP files)

I tryed both and they worked, but the ODBC is usefull if you need compatibility with a previous app.

Still waiting for SQLite WRAPPER from Martin Vernhout.

Hope this will help,

Rino

Cpomoi
Member
Member
on

Hello

I'm a french student (sorry for the bad english ) and I've got a problem with the VI named "SQLite" you've uploaded on Labview website.

I encounter some problems when I use "SQLite Select" and "SQLite Query". They seem not to be detected by the database; but the database and the dll file is already included in the source of the VI. I join you with this post a screen shot of my project. I use Labview 2009 Student Edition.

I hope you can help me.

Best Regards,

Paul

http://j.imagehost.org/0187/Diagramme.jpg

http://j.imagehost.org/0751/Front.jpg

jjcimon
Member
Member
on

I am working with the odbc driver instead but I am interested ro get the wrapper you uploaded and I can send you an answer bout your problem soon as I can use it.

vernhout
Member
Member
on

@niweek?

let's meet

Martin Vernhout, PA2VMA

---

Sent from my iPad

---

Tedmu
Member
Member
on

Hello,

I'm interested to test this for my application. Is it possible to have it for testing, please?

Best Regards,

Teemu

jcarmody
Trusted Enthusiast
Trusted Enthusiast
on

There's a SQLite toolkit available on LAVA, here.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

SteveChandler
Trusted Enthusiast
Trusted Enthusiast
on

The link on LAVA is broke.

=====================
LabVIEW 2012


jcarmody
Trusted Enthusiast
Trusted Enthusiast
on

It's over here now.  (see this post for the connection)

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

DT1981
Member
Member
on

Hello,

 

Previous developers at my company were using this wrapper. I see the function calls to lvsqlite_exec at the lowest level, calling a dll, and I see the input parameters that were used, however, I am wondering if there is a timeout parameter, because I found some queries can take several seconds to execute in the event that the query contains millions of items. I'd like to have the system bail from the query if that was to happen but I dont see a timeout input.

 

Is there documentation? Is there a way to alter this function to have a timeout?

 

Thank you.

Contributors