Jump to content

LAbVIEW Database toolkit-


Recommended Posts

Hi all

I'm Relatively new to the LabVIEW database tool kit and have worked my way through to successfully have connectivity to a SQL 2005 and Mysql database servers in which queries returned both tables and contained data.

The core system is a SQL server 2005 with a developed extension table held on a remote database. Read access is only granted to the core system.

The aim is to either link these databases through some "Labview linking (composite)" or "SQL Linking" function to return query results across unions on both databases.

I am able to establish individual connectivity to each DB successfully and perform queries. But lack knowledge on and experience on joining two remote databases within the one LABVIEW sql query? For the sake of normalisation and due too large inefficiency overheads we don’t want to have a duplication of the data table on the remote system database where our newly created tables reside..

Can this linking be done?

Could someone point me to some good LabVIEW Database examples illustrating above? Or give an explanation?

With in a database there are Char and Varchars but LabVIEW has only strings. How do you best define and handle these in LABVIEW for columns of this type descriptions in a Database?

Cheers

Regards

Gregory Nicholls

Edited by jollybandit
Link to comment

I am able to establish individual connectivity to each DB successfully and perform queries. But lack knowledge on and experience on joining two remote databases within the one LABVIEW sql query? For the sake of normalisation and due too large inefficiency overheads we don’t want to have a duplication of the data table on the remote system database where our newly created tables reside..

You can join tables in a database, but I don't know of a way to join tables in different databases. "LabVIEW SQL queries" are the same thing as regular SQL, so your best bet it so find a manual for SQL statements.

With in a database there are Char and Varchars but LabVIEW has only strings. How do you best define and handle these in LABVIEW for columns of this type descriptions in a Database?

There isn't anything to handle unless you're trying to use a stored proceedure. The SQL statement is processed inside the database and it knows how to deal with it.

Tim

Link to comment

Hi,

I am not so sure where the data will be used, and this affects the solution. I use SQL servers quite often, and prefer using simple sql "SELECT" statements to gather the required data.(Even across multiple databases and schemas will multiple queries) Performing sanity logic, and required actions natively in LabVIEW is much easier and quicker. The only problem here is that bandwidth penalty of selecting an entire table. I usually only get columns that are actually needed, and only selecting large cells like "blobs" with very selective sql queries. I would recommend learning about sql commands and syntax.

The database connectivity toolkit will a 2d array of strings, which can hold almost every data type, which then can be converted to the correct data type.

Mike

Link to comment
  • 3 months later...

I'm only dealing with different databases on the same server. In this case you actually don't need to care about "linking" of these databases, they may have foreign keys across databases for integrity and that's it. SQL query can join tables from different databases, you just need to specify the database name before the table and field name. The queries can be sent from you LabVIEW application or be in stored procedures in database, no matter.

I preffer to move as much logic as possible from LabVIEW application to SQL queries/Stored Procedures. LabVIEW is much slower in case of complex queries. My initial version which using just SELECT and manipulating with data in LabVIEW required 40 sec to get data out of DB, compare to fraction of second for the replacement SQL query. Learn SQL, there is no way to avoid this in the Relational Databases world.

As a 'link' solution for your remote database you may try to create views in your 'local' database for all required tables from 'remote' database, there is no duplication of the data tables in this case and data in views is always actual. Then, from LabVIEW you establish connection to the 'local' database only and works with it. But this solution is Read Only.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.