Deleting database records/recordsets from LabVIEW
I would like to manage database information with LabVIEW. Any guidance or sample VIs on deleting records or recordsets from data displayed in a listbox in LabVIEW?
Ok, if the database you're talking to was designed correctly the table you're reading data from should have a "primary key value" this is a field containing a unique identifier. Primary keys are typically integers because integers are faster to search and index--but they don't have to be.
When you are performing your select statement to retrieve the data, be sure to also read the primary key. Keep this column of data in an array that you can refer to.
Now, when your user selects one or more items to delete, the code looks up the primary keys for those items and formats an SQL delete statement to delete just those records.
If the data you are reading comes from several tables using a "join", the problem gets a little more difficult, but
the same basic technique should work, the SQL will just be more complex.
The worse case situation is if you are getting your data from what is called a "view". If that is the case, you will need to spend sometime with someone in your MIS department and workout exactly how to do the delete.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Similar Messages
-
Deletion of condition record (vk11) from Database
Dear,
can anybody tell me how to delete condition record completely from database nt delettion flag.
regards,
DebeshHi,
I think archive the condition record is better option for you insted of deleting it !!!!
For archiving please go through the below link.
http://help.sap.com/saphelp_45b/helpdata/en/8d/3e5ae4462a11d189000000e8323d3a/content.htm
Hope this will help you to resolve your query!
Regards,
KRishna O -
How to delete a database record by using EJB entity beans
Hi, All,
Does anyone know how to use entity bean to delete a database record? I have all the EJB entity beans created, including access beans to each. I can successfully create records, find and update records, however, I haven't find a way to delete records yet.
Your response is appreciated.
CathyPlease see EJB Forums for continue discussion on this subject.
Reference titile: "how to delete database record by using CMP entity beans " -
Deleting Duplicate Records -EIM Import Account & Contact
Hi,
Can anyone give me the query to delete duplicate records both from legacy as well as from the tables imported.Try this..
DELETE
FROM table
WHERE ROWID NOT IN(SELECT MAX(ROWID)
FROM table
GROUP BY column)
For which column u have duplicate rows that column u have to give in group by clause so except max of rowid it will delete all records. -
Delete a record from a table in a Database with Database Connectivity
I can't find the function from the Database Connectivity library that allows me to delete a record from a table of the database. I tried to use DB Tools Free Object.vi function but this one deletes only the table created with a query.
ThankyouI have used the sql query as described above and it works fine with access DB and the DB toolkit, the free object vi only deallocated a recordset's references this will noty alter the database since the record is a copy of the databases information. The SQL delete function is very versatile and you should be able to delete records with no problem.
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA -
Delete a record in MDT Database from WinPE during Pre install
Hello Experts,
This is my requirement
1) MDT Deployment database will be updated with MAC address of new laptops.
2) All new laptops will be pre-configured with PXE booting as primary boot option. (When the MAC address is not available on Deployment DB, System boots via hard disc).
3) Deployment Tool Kit (MDT) will deploy the image to all the MAC addresses available on deployment DB (Step 1)
4) After deployment, database entry for corresponding laptop should be deleted automatically such that system boots via hard disc
Is there any way to delete a record from MDT database in Pre-Install step of the task sequence, such that Laptop boots from the hard disc after restart from PE install? Idea is to delete the record of corresponding laptop after PE install such that PXE boor
doesn't pick up anything from the share.
Regards, karthik.Basically, this would be the same effect if you have a PXE advertisement for a certain number of machines. And your PXE advertisement is always mandatory, except you only want to install machines which occur in the database. Why no try to solve it in another
way? Because this is very devious.
If this post is helpful please click "Mark for answer", thanks! Kind regards -
How to delete the records from database table without using work area
Hi all,
The purpose of the down program is to delete the entire contents from all the tables. The deletion of the table should be in sorted manner. Is there any other way to write the code more efficiently,
TABLES: ZFFMCTL_AP, ZFFMHDR_AP, ZFFM_CHANGE_LOG, ZFFMDTL_AR, ZFFMHDR_AR, ZFFMDTL_JV, ZFFMHDR_JV, ZFFMDTL_SKF,ZFFMHDR_SKF,ZFINVOICE_DETAIL, ZFFMMASTER, ZFFMLOGREAD_CLUS, ZFFMCTL.
DELETE ZFFMCTL_AP.
IF SY-SUBRC = 0.
DELETE ZFFMMHDR_AP.
IF SY-SUBRC = 0.
DELETE ZFFM_CHANGE_LOG.
IF SY-SUBRC = 0.
DELETE ZFFMDTL_AR.
IF SY-SUBRC = 0.
DELETE ZFFMHDR_AR.
IF SY-SUBRC = 0.
DELETE ZFFMDTL_JV.
IF SY-SUBRC = 0.
DELETE ZFFMHDR_JV.
IF SY-SUBRC = 0.
DELETE ZFFMDTL_SKF.
IF SY-SUBRC = 0.
DELETE ZFFMHDR_SKF.
IF SY-SUBRC = 0.
DELETE ZFINVOICE_DETAIL.
IF SY-SUBRC = 0.
DELETE ZFFMMASTER.
IF SY-SUBRC = 0.
DELETE ZFFMLOGREAD_CLUS.
IF SY-SUBRC = 0.
DELETE ZFFMCTL.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
Waiting for response,
Thanks in advance
JohnWrite this way....
TABLES: ZFFMCTL_AP, ZFFMHDR_AP, ZFFM_CHANGE_LOG, ZFFMDTL_AR, ZFFMHDR_AR, ZFFMDTL_JV, ZFFMHDR_JV, ZFFMDTL_SKF,ZFFMHDR_SKF,ZFINVOICE_DETAIL, ZFFMMASTER, ZFFMLOGREAD_CLUS, ZFFMCTL.
DELETE ZFFMCTL_AP.
CHECK SY_SUBRC = 0.
DELETE ZFFMMHDR_AP.
CHECK SY_SUBRC = 0.
DELETE ZFFM_CHANGE_LOG.
CHECK SY_SUBRC = 0.
DELETE ZFFMDTL_AR.
CHECK SY_SUBRC = 0.
DELETE ZFFMHDR_AR.
CHECK SY_SUBRC = 0.
DELETE ZFFMDTL_JV.
CHECK SY_SUBRC = 0.
DELETE ZFFMHDR_JV.
CHECK SY_SUBRC = 0.
DELETE ZFFMDTL_SKF.
CHECK SY_SUBRC = 0.
DELETE ZFFMHDR_SKF.
CHECK SY_SUBRC = 0.
DELETE ZFINVOICE_DETAIL.
CHECK SY_SUBRC = 0.
DELETE ZFFMMASTER.
CHECK SY_SUBRC = 0.
DELETE ZFFMLOGREAD_CLUS.
CHECK SY_SUBRC = 0.
DELETE ZFFMCTL. -
Add records in table ACCESS from labview by ActiveX
I try to add records in table of database ACCESS by an ActiveX from labview but my programme doesn't work ...
What is the problem ?
I have attached my VI
Thanks in advance
hasna
Attachments:
base1.vi 35 KBOn Thu, 11 Jul 2002 08:13:48 -0700 (PDT), Lab Viewer
wrote:
>I saw your previous posts related to ActiveX/Access. I once had the
>same kind of problems. It's not an easy task (without a toolkit)
>because you have to learn the "interface" provided by Access/DAO in
>order to manage what you are trying to do.
>In my case, the best solution it was to follow the Visual Basic for
>Applications examples included in MS Access. Even though you don't
>know VB, don't be afraid. Important is to figure out from that example
>what methods/properties you need to use, the proper order to call them
>and eventually some parameters. You are dealing with the same
>methods/properties in LabVIEW, the difference is that you have them in
>a graphical format instead of text
.You can find these examples by
>going to MS Access help > Index and type DAO objects and then choose
>one to start with (Database, recordset, field =85).
>
>Hope this helps
The examples on NI's website were originally written using the DAO
model, but the latest one was written using the ADO model.
However, I am unable to find either example LLBs on their website
anymore. Maybe they're trying to push their SQL Toolkit.
Along with the VBA help in MS Access, I *highly* recommend the book
ADO Programming for Dummies. Wonderful book. Helped me understand the
VBA help. :-)
Again, if anyone is intersted in VIs using ActiveX that works. He/she
is welcome to email me.
Linda -
How do I copy recordsets from one database table to another?
I am using the Database Connectivity Toolset, and would like to copy either one recordset or multiple recordsets from one Access table to a table in a different database. I would like to do it directly with the data in variant form, but I can't get it to work. I can get it to work(on a small test table) if I first convert my source variant data to a cluster, then insert that into the other database table. My real database has many items with a variety of date types. Can I copy directly variant to variant?
Is it necessary to read all the data back into LabVIEW first? The reason I'm asking is that it is much more efficient to just use SQL statements to get the data you need and write that directly to the second database. I did a quick Google search on it and came up with lots of responses on what the correct syntax is for setting that up. Using an SQL command to copy the data back and forth is analogous to copying data from one file to another using the Copy file function rather than reading the entire contents of the file, converting the file string to the data arrays, converting back to a string, and then writing it back to another file.
Chapter 5 of the Database Connectivity Toolset User Manual describes how to execute SQL queries.
If you do need to actually
see the data in LabVIEW first, then the only way to get it back into the other database is to convert those variants to LV datatypes and then cluster those values again and write them back out to the second database. -
How to delete a record in database it should be effect in XML
In my application wheni insert a record in database it automatically inserted in XML now my problem is when i delete a record in database it should also effect in XML
plz anybody anything knows about this reply meFirst up all, when u insert a record in database, how the data is inserted in xml file. Is there any application written for that?
So when u delete the record from database,and want that same data should be deleted from the xml file, write a application to delete data from xml, and call that when u delete record from database.
U can Write application using DocumentBuilderFactory.
And using XQuery, you can delete data from xml.
Hope this will help u.
.....yogesh -
Deleting/Updating records from an object table in PL/SQL
Hello All,
VER:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
I have created an object and inserted records in it. Is there any way we can delete/update records from it. I do not want to delete based on iteration like delete.collection but I would like to know if we can delete directly from obj like delete from table...
CREATE OR REPLACE TYPE test_type AS OBJECT
col1 number,
col2 varchar2(100)
CREATE OR REPLACE TYPE tab_type is table of test_type;
DECLARE
test_tab tab_type;
l_cnt NUMBER;
BEGIN
select test_type(col1,col2) bulk collect
into test_tab from (select 1 as col1,'test1' as col2 from dual
union all
select 2,'test2' from dual);
IF test_tab.count>0
THEN
DELETE FROM TABLE(CAST(test_tab as tab_type)) a
where a.col1=1;
END IF;
l_cnt := test_tab.count;
END;Thx
Shank.SB,
I have a scenario wherein I insert few records into a collection table. I'm gonna filter few records from collection table based on the filter.
I want to delete the records that didn't match the filter. Right now, I'm inserting the records into a physical table and deleting from there. I do no want to use a physical table. Trying to avoid it.
Would like to delete from collection itself.
DELETE FROM TABLE(CAST(lv_attr_filter_tab as EDMS_CSPP_DISC_REQ_TAB_TYPE))
WHERE NOT EXISTS (SELECT 1
FROM edms_disc_lines_stg edls
WHERE edls.req_id = edrg.request_id
AND edls.disc_line_id = edrg.discount_id
AND UPPER(edls.disc_status) IN ('ACTIVE'); -
The product documentation of the sensor and the datasheet is attached. Also Digilent MXP Breadboard's image is attached.
I've connected the sensor to myRIO using the starter kit's MXP breadboard: http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,842,1216&Prod=MXP-BB
The output of the sensor is in digital. My initial goal is to get digital output in form of 8 or 12 or 14 bits and then convert them to decimal numbers and record them.
Pin 1 of sensor is Data, which is connected to myRIO's connector A, DIO1 pin 13.
Pin 3 of sensor is Clock, which is connected to myRIO's connector B DIO5/SPI.CLK pin 21. According to the datasheet of the sensor, if VDD < 4.5V then Clock should be set to 1MHz.
Pin 4 of sensor is Ground, which is connected to Digilent MXP Breadboard GND pin.
Pin 8 of sensor is VDD, which is connected to Digilent MXP Breadboard +3.3V pin. Supply voltage range is 2.4-5.5V and recommended voltage is 3.3V.
I need to be able to send the following commands to the sensor from LabVIEW.
Measure temperature: 00000011
Measure relative humidity: 00000101
Then, myRIO has to wait for maximum 20 milliseconds (ms) for 8-bit measurement, 80 ms for 12-bit measurement, and 320 ms for 14-bit measurement.
Two bytes of measurement data will then be transmitted. myRIO as microcontroller must acknowledge each byte by pulling the DATA line (pin 13) low. All values are Most Significant Bit (MSB) first. Note that for 8-bit result, the first byte is not used. Finally, myRIO has to terminate the communication after the measurement data Least Significant Bit (LSB) has been received by keeping ACK bit, which is the LSB bit, as high.
Attachments:
Digilent MXP Breadboard.jpg 96 KB
Sensirion-Temerature-Humidity-Sensor-Documentation.pdf 136 KB
Temperature-Humidity-Manufacturer-Datasheet.pdf 323 KBHave you searched the forum?
http://forums.ni.com/t5/LabVIEW/Sensirion-sht7x-labview/m-p/350958/highlight/true#M179022
Greetings from Germany
Henrik
LV since v3.1
“ground” is a convenient fantasy
'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ' -
How to delete a record in Database View?
HI All,
I have created a Database View using tables LIKP,LIPS,VBUK,VBUP.
In that view I am getting a extra record which is not exit in any tables
but its getting in database view.
I tried buffer memory refresh and even tried SE16n , SE11(thro CODE(DELE))..But record has not been
deleted.
Plz suggest wat shud i have to do to delete the record.
Thanks in advance and help realy appriciate.
Regards
Steve>
Steve Johnson wrote:
> In that view I am getting a extra record which is not exit in any tables
> but its getting in database view.
Your intention should be in search of the root of that extra record. Not the deleting it without knowing anything.
Sure, You have put join conditions correctly?
Cheers -
Please will like to get my deleted recording back from quick
Please I will like to get my deleted recording back from quick voice app
Was it backed up ? If it was - restore from backup (of course, everything else will be restored too).
If it wasn't - you have no way to get it. -
Deleting a record from Master data
Hi all,
I need some help with deleting a record from the master data.I did go to the master dta maintenance screen and selected the record to be deleted. I saved it. I received the message, "master Data record cannot be deleted".
I then went into transaction slg1 to check for the details of the record. A message stating " Master data record XXX is being used in the cube /BIC/Dzzzyyy312.
This record is no longer needed by the end user and was requested to be deleted. Could some one tell me if there is a possibility to delete this unused masterdata record. Your suggestions are appreciated.
Regards!Hi Sumana,
Check this...Similar Post..
MAster data deletion throws a dump
Hope it helps
Srini
Maybe you are looking for
-
How do i move my itunes acount from one computer to the next
i had my itunes a one computer but then i decided to use itunes on a differrent computer in my house. how can i get all my app,playlists, and my librarie over to the new computer.
-
How do I fresh-install OSX ML without the disk?
Hello guys, Sorry I am kind of newbie with this stuff but I have a question and I hope you can help. I have a Macbook Pro 2010, it originally had "OSX Snow Leopard" installed and it came with a "recovery disk". So, when OSX Mountain Lion came up, I b
-
Installing Windows 8.1 Enterprise on a Windows 8.1 OEM Laptop
Hello, I have a new ASUS laptop running an OEM version of basic Windows 8.1. I've installed many applications and put much time personalizing the GUI. I wish to upgrade it to Windows 8.1 Enterprise (I have an enterprise key from MVLS volume license).
-
Calling Stored Procedure with TestStand to SQL 2000
When I run the Stored Procedure in the query analyzer it returns the recordset fine. I am not specifying any parameters. I am Using TestStand 2.01 and SQL Server 2000. I am using the OPEN SQL STATEMENT step to call the SP. When I run the SP in TestSt
-
Dimension size docment size resolution
Use the picture on website. Really no idea with Resolution, Document Size, Dimension Size and Fit Image Function. Use on Website, don't need to care the Document Size, right? Changing with Resolution Size and Resolution, some time, the Resolution is