LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to write data in different tables of same database in sql server using labview at same time.

hello every one 

plz tell me how to add data in two different table in a database at same time

 

0 Kudos
Message 1 of 7
(4,631 Views)

Have you tried it? I seem to remember that the SQL Server ODBC connector supports multiple queries in a single statement (separated by a semicolon ';') so you can just put two insert queries into a single request to the server.

 

Failing that, you could write a stored procedure which takes your data and inserts it into the two tables.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 7
(4,627 Views)

yes .i tried it using database connectivity tool but it show error " no of columnsare not equal to parameter".

0 Kudos
Message 3 of 7
(4,619 Views)

Yeah, you won't be able to do it using the insert VI from the DB toolkit - you'll need to execute a custom (parameterised?) query that does one of the options I mentioned in my first reply.

 

Why do they need to be inserted at the same time? Can't you insert into one table and then the other immediately afterwards?


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 7
(4,615 Views)

i don't know how to get it done with qyeries.can you provide me example.

yeah it  be written one after another.please guide.

0 Kudos
Message 5 of 7
(4,585 Views)

If it can go in one after another, why not use the INSERT database VI multiple times - once for each table?

 

For the query - it's just a basic SQL query - "INSERT INTO tablename (column1, column2, column3) VALUES (value1, value2, value3);" If you want, you can create a parameterised query using ? instead of value1 etc. and then use the bind parameter to assign your values to the query parameters.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 7
(4,578 Views)

ACTUALLY I WANT TO USE THIS VI I N A POP UP WINDOW .what i want is ..

Download All
0 Kudos
Message 7 of 7
(4,571 Views)