LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Record editing or delection with Datbase Toolkit???

Hello,

I've been trying to determine how to do some fairly simple things with the database toolset, and I haven't figured it out yet:

I want to be able to change a record with new information. What I have done so far: I've used a simple query with "DB Tools Execute Query" to get a recordset reference (in this instance choosing a patient, using their patient #). Then I thought I would be able to change a parameter with "DB Tools Set Parameter" but though in the help it says it accepts a recordset reference - I get a red-Xed wire, so the polymorphism isn't working. Even if this worked, I'd have to change the record one parameter at a time - is there a command to do this for the whole record (ie. like an 'inse
rt' command, but doing a replacement instead).

Conversely, this could easily be achieved by deleting the old recordset and then using an insert. But I haven't found a delete command either. Granted, I'm sure if I do a little more SQL homework, I could find a way to do it with statements, nonetheless, I figured there must be some vi's that could handle these fairly simple routines.

Thanks for any help.
0 Kudos
Message 1 of 3
(3,090 Views)

Hi,

There aren't any VIs in the toolset that replace/update a record. I would recommend using the SQL Update command. For the syntax of the Update command, refer to the link below.

UPDATE syntax [link removed; thread no longer available]


Hope this helps!

Travis H.
National Instruments

Travis H.
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 3
(3,090 Views)
OK, I'll just do it that way.

I'm a little surprised it wasn't included in a vi though. I guess since you have to specify your parameters it's just easier to do the SQL statement yourself.
0 Kudos
Message 3 of 3
(3,090 Views)