LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save data in two different databases

Hello 

 

I hope you can help me

 

I wonder if I can save data in two different databases, I need to save the information of my program in two different databases, Is that possible?

If so how?

 

Regards

 

Thank you

0 Kudos
Message 1 of 9
(4,104 Views)

How to do it will vary with what 2 databases you are using, but build code to save to one database and then build code to the second database. Then run both sets of code to save to two databases.

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
0 Kudos
Message 2 of 9
(4,097 Views)
Off course it is. You can save to how many databases you want to. You save to another database in exactly the same way you do with a single, just with a different UDL file or whatever connection type you are currently using. Simple enough for you to have tried.
0 Kudos
Message 3 of 9
(4,092 Views)

So I have to build another program but with other UDL connection?

Is there another way in that I can join the UDL connections?

0 Kudos
Message 4 of 9
(4,076 Views)
No, you can have them both in the same program.

Two different databases require two different connections if you do it all in LabVIEW. You could have one database write to the second, I think. Study the database you are using.
0 Kudos
Message 5 of 9
(4,072 Views)

I can´t join two connection path wires and connect them to the same open data base connection, Because when I try to join two different connection paths the program shows me a broken wire. So I have to create a open database connection for every connection path

0 Kudos
Message 6 of 9
(3,888 Views)
Of course you can't use different paths to the same open. Each database requires a different open since, they are, after all different databases. Where did you get the idea that you could use a single open with multiple paths?
0 Kudos
Message 7 of 9
(3,880 Views)

@DanielPVilla wrote:

I can´t join two connection path wires and connect them to the same open data base connection, [...]


Make the two paths into an array, wrap your database code in a For loop and wire your path array in.

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

0 Kudos
Message 8 of 9
(3,844 Views)

If the databases are identical, depending on the database engine you are using - many support replication and mirroring which means you write to one master database, and the changes get automatically propagated to any number of specified slave databases.

 

Otherwise, you'll just have to do two operations instead of one for each write to the database. For example, you could have an array of databases and use a for loop to perform the database operations for each one.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 9 of 9
(3,830 Views)