ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update Child Database from Parent On another Computer

I'm using the Database connectivity toolkit to store [Widget Data] in a relational database on my network server.

 

Unfortunately, the network speed is very slow during peak hours so, I'd like to create a read-only copy of the main database on my local computers in (similar the answer to this question on SO ) and update it periodically when my system is not in use. 

 

Trying my best to implement their solution I have the following:

 

Capture.PNG

 

However, I'm getting a syntax error for an incomplete query clause. How can I fix this?

0 Kudos
Message 1 of 4
(2,908 Views)

Looking at your expressions... and the SQL tutorial site https://www.w3schools.com/sql/sql_update.asp

It would seem that you have not used a complete SQL expression.

 

SQL UPDATE:

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

 

SQL INNER JOIN:

SELECT column_name(s)
FROM table1
INNER JOIN table2 ON table1.column_name = table2.column_name;

 

I would suspect that you would need syntax something like

UPDATE table_name

SELECT column_name(s)
FROM table1
INNER JOIN table2

ON table1.column_name = table2.column_name;

(But wouldn't know for certain without playing to get rid of the expression errors)

 

Hope this helps

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2022 SP1 installed
0 Kudos
Message 2 of 4
(2,870 Views)

I think it has something to do with my paths. Right now I've simplified my Execute to

 

SELECT *
FROM C:\Database File\LocalDbname.MyTable as LT 
RIGHT JOIN \\Server\Database File\GlobalDbname.MyTable as OT
ON LT.Col1 = OT.Col1

I've confirmed that

 

SELECT *
FROM MyTable as LT 
RIGHT JOIN MyTable as OT
ON LT.Col1 = OT.Col1

 Works

 

That means my problem is selecting the file paths from the two different databases. I know that the file path:

C:\Database File\LocalDbname.mdb

 has a few spaces in it. Is there something I need to do to deal with that?

0 Kudos
Message 3 of 4
(2,859 Views)

If you use an ODBC database connection, with a database driver, then you can bin the paths and just use the database name.

Have you tried just using the database name instead?

It does look like a path issue - you probably have illegal chars in there.

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2022 SP1 installed
0 Kudos
Message 4 of 4
(2,847 Views)