Can I retrieve data from a multiple select query?

I recently have been able to consolidate many queries into one large one, or into large compound queries. I found an instance where I am using a select query in a for loop that may execute up to 400 times. I tried building a huge compound query, and using DB Tools Execute Query vi, followed by the DB Tools Fetch Recordset Data vi. The query executes at the database without an error, but the Fetch Recordset Data vi only returns the first instance. Is there a way to retrieve all the data without having to send up to 400 separate select queries?

Sorry I didn't replt earlier, I was on vacation. The query I am using is to check serial numbers, and determine if they are all valid. The programs purpose is to define a serial number to a pre-existing part number. Our company makes inclinometers and accelerometers, and this entire series of LabVIEW programs is designed to automate the calibration and testing of these units. The part number definitions can contain 3 or 4 hundred parameters, so the database itself consistes of 44 tables with potentially several hundred columns per table. It is designed to not only provide definitions to every part number, but also to store all potential raw unit data to be calculated and formed into a report at any time. The logistics of getting that much data in and out of the database have forced me to do things more effeciently. The actual query in question is to take each serial number either manually entered, or automatically picked, and see if they already exist with the part number they are being defined as. If there are any duplicates, then the program will alert the operator that serial numbers x, y, and z for instance have already been asigned as the part number in question. Currently I run a simple query once for each serial number. This works, but there may be 200 serial numbers assigned. Also the serial numbers can contain upper or lower case letters. By making all the serial number letters into capitals, then into lower case, it could mean up to 400 individual queries going out over the LAN. This is a bandwidth hog, and time consuming. I started experimenting with compound queries. The actual query used is below.
SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000005';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000006';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000007';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000008';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000009'
When I execute this query, SQL Server 2000 has no problem with it, but the DB Tools Fetch Recordset Data vi only returns the first match. I think my answer may lie with OR statements. Rather than sending what amounts to potentially dozens of individual queries, I should be able to chain them into one query with a lot of OR statements. As long as the OR statement is not an exclusive OR statement, I think it should work. I haven't tried it yet, and it may take some time to get the syntax right. The query is built in a for loop with the number of iterations equal to the number of serial numbers being defined. Once I get this working I will alter it to include both upper and lower case letters that can be included in the query. Any suggestiona of how the query should be structured would be most helpful, or another way to achieve what I am trying to accomplish.
SciManStev

Similar Messages

  • How to retrieve data from a multiple selected listbox?

    In order to get the data from a field, i use:
    String strName = request.getParameter("name");
    But what if the parameter name is a listbox and that listbox is enabled to receive multiple selection?
    How do i do then?
    Thanks

    java.lang.String[] getParameterValues(java.lang.String name)

  • Can I retrieve data from my iPhone 4 hard drive without the SIM card?

    Can I retreive data from my iPhone 4 hard drive without the sim?

    There is no hard drive in an iPhone, it is all solid state memory. If the phone is working you can always copy content from it. If it is not you will need to restore and activate it, and that requires a SIM card.

  • How can I retrieve data from one table to another automatic in SQL?

    Hi, everione,
    I am having a big problem, trying to create datebase.
    I have 3 tables: SUPERAVATAR, MASTERAVATAR, MEGAAVATAR.
    - SuperAvatars are heroes in an online role playing gaming. They have an ID, ‘superavatarID’ which contain an UNIQUE NUMBER NOT NULL PRIMARY KEY to identify them.
    A wisdom – ‘trickster’,’conjuror’,’magician’, etc..
    A current owner… who is the user or player of the game and has that Super Avatar– we associate the link to USERID to know the person.
    SuperAvatars can be fathers or mothers of Mega Avatars.
    -MegaAvatars are the children of SuperAvatars…. They also have an ID UNIQUE NUMBER NOT NULL PRIMARY KEY to indentify them.
    A magic power – it can be a ‘Leader’ or ‘Sheep’…
    A ‘parent’ – parent is the number identifying to know to who Super Avatar belongs.
    e.g.
    SUPERAVAT WISD CURRENTOWNER FATHEROF MOTHEROF
    1 Thick 3 1
    2 Mentally Ch. 11 3
    3 Smart 9 2
    4 Genius 16 4
    5 Thick 19
    MEGAAVATARID MAGICPOWER PARENT
    1 MAGICIAN 1
    2 WIZARD 3
    3 SORCERER 2
    4 MAGICIAN 4
    -We see that MEGAAVATAR 1 has a magic power as Magician and his father is ‘1’. ‘1’ identifies the SUPERAVATAR.
    We see SUPERAVATARID…. who has the number ‘1’? the first in the row… who has wisdom – thick and he belongs to the USER with ID number 3.
    -We see MEGAAVATARID… we choose the number 2…. His magic power is as WIZARD… and his father is the number 3.
    We see SUPERAVATARID now… we look up the SuperavatarID 3…. We can see he has a wisdom – GENIUS… who belongs to the USERID 16 and he is father of MEGAAVATAR number 2.
    The list can carry on and never stop.
    I have this Problems:
    We create in this example 3 tables: Users, SuperAvatar, MegaAvatar
    SQL
    CREATE TABLE users(userID NUMBER CONSTRAINT pk_user PRIMARY KEY,email VARCHAR2(50) NOT NULL UNIQUE,password VARCHAR2(15) NOT NULL UNIQUE,subscription CHAR(8) NOT NULL CHECK (subscription IN('ACTIVE' , 'INACTIVE' ) ) );
    CREATE TABLE superavatar(superavatarID NUMBER CONSTRAINT pk_superavatar PRIMARY KEY, wisdom VARCHAR2(19) NOT NULL CHECK (wisdom IN ('THICK', 'MENTALLY CHALLENGED', 'AWAKE', 'SMART', 'GENIUS')), currentOwner NUMBER NOT NULL, fatherOf NUMBER,motherOf NUMBER);
    CREATE TABLE megaavatar (megaavatarID NUMBER CONSTRAINT pk_megaavatar PRIMARY KEY, magicPower VARCHAR2(12) NOT NULL CHECK (magicPower IN('TRICKSTER','CONJUROR','MAGICIAN','WIZARD','SORCERER')), parent NUMBER);
    Now, the 3 tables are created…..
    What happen when we try to insert values to this table?
    In this case we insert to User Table some examples:
    INSERT INTO users VALUES('3','[email protected]','great78','ACTIVE');
    INSERT INTO users VALUES('9','[email protected]','chrisandra)','ACTIVE');
    Now, we insert to SuperAvatar some examples;
    INSERT INTO superavatar VALUES('1','THICK','3','1','');
    INSERT INTO superavatar VALUES('3','SMART','9','3','');
    |
    |
    ‘9’ is the UserID that we already insert to the User table
    What’s the problem?
    We have to insert manually the data from USERID to CURRENTOWNER as we didn’t match or link CURRENTOWNER from SUPERAVATAR Table to USERID from USER Table with a SQL CODE.
    What happen if we have thousands of USERS that they register to this game…? We will never know to how belongs that SUPERAVATAR but if someone do it manually can spend a year.
    I am trying to fix this problem …. I add in SUPERAVATAR TABLE ‘CHECK’ in currentOwner..
    SQL> CREATE TABLE superavatar
    (superavatarID NUMBER CONSTRAINT pk_superavatar PRIMARY KEY, wisdom VARCHAR2(19) NOT NULL CHECK (wisdom IN ('THICK', 'MENTALLY CHALLENGED', 'AWAKE', 'SMART', 'GENIUS')),
    currentOwner NUMBER NOT NULL CHECK (currentOwner IN(SELECT userID FROM users)),
    fatherOf NUMBER,
    motherOf NUMBER);
    ERROR:
    ORA-02251: subquery not allowed here
    It doesn’t work.
    Please HELP, I have exam tomorrow
    thank you
    Desy

    Hallo,
    you can use trigger on table USER and fill the userid in AVATAR.currentowner,
    but i don't understand, how you join these tables ?
    Which user id must come in which column currentowner ?
    Design problem ?
    Regards
    Dmytro

  • Can I retrieve data from a restored iPhone?

    I restored my iPhone remotely because I thought it was stolen - then found it. A security service in my town claims to be able to retrieve data for $100. Is that possible?

    He says he has software that can do this kind of thing. Does it matter if he has my mac account? I don't backup on cloud - backup on iTunes.

  • How can i retrieve data from a macbook pro that has the flashing folder with an ? mark in it, to a brand new iMac

    I want to do a data recovery of my 15" MBP that has the flashing folder w/ ? mark in it, to an iMac 21.4"; how can i go about that?

    DJSMACC wrote:
    How do I go about removing the internal drive and mount it to an external enclosure @Linc Davis??? Sorry that I'm not too hip with all the technology lingo & etc?
    You'll have to watch the video and buy a few tools to extract the driive.
    http://eshop.macsales.com/installvideos/
    Then use something like this to connect to the other Mac or PC with MacDrive installed.
    http://eshop.macsales.com/item/Newer%20Technology/U3NVSPATA/
    You also can get the same adapter elsewhere online for as low as $12 I've seen.
    Likely it's a USB 2,1 which your Mac's can only accept USB 2,1 anyway, no need to pay more for a USB 3 unless you want too.
    No compensation for site or product mention
    You likely should be having a professional or Apple tech attempt to bypass the firmware password if you forgot it, it's the best way to go about things.
    Just because the Mac has a spinning wheel gray screen at boot doesn't mean it's ruined, you just need to bypass the firmware password and then from there fix the machine's cause for not booting, which is likely a software issue from a third party kernel extension file.
    Step by Step to fix your Mac
    You should know that opening the iMac could likely ruin it and will ruin any warranty or AppleCare, and if it's a Early 2011 model or later you can't replace the hard drive yourself as Apple has proprietary software installed on the drive that needs to "talk" to OS X to control the fans speeds.
    Good Luck.

  • Can you retrieve data from a sync-deleted app

    I just plugged my iphone into my computer and lo and behold the subsequent sync" sucked a random grip-load of my apps off of my phone, without me asking it to do so.
    All the apps are backed up in my itunes and re-loaded easily enough. However, I had a bunch of data forms in an app called Documents 2—data I had entered for my work. Can I get that data back? I pulled the only .ipa file for that app out of the trash, which was from the iphone os update I did a couple of months ago (after which, that app was still working just fine and the data was still there.
    The app is back on my phone but no saved documents. Wantsezes … …
    I also lost most of my text message archive on a text-free app--anything that precedes three days ago, 2 days before the capricious app-suck occurred.

    Unfortunately it's probably gone.  You could try a 3rd party program like PhoneView (mac) or Touchcopy (windows) to look at your phone to see if there's any app data left but you probably won't find any.

  • How can I retrieve data from TIme Capsule?

    I have lost my contacts on my IPhone and also on contacts on my Mac.  How can I resrore this information from time capsule?  I have opened Time Capsule and clicked resrote on Contacts and nothing seems to happen

    See if this Helps
    Video on Restore From Time Machine
    http://support.apple.com/kb/VI29

  • Can I retrieve data from crashed hard drive on MacBook Pro?

    Any help appreciated

    First, get yourself an External Enclosure and a new drive that can be used eventually to place inside your MacBook.
    Install Mac OS X on the new External and Boot from it. Now your Mac is operating again.
    Later, you can swap the new drive with the old drive and get back your portability.
    Mac OS X has over 250,000 files in it. Booting is very complex. Just reading a few files off your old drive may be relatively easy -- or may be completely impossible.
    If you have a spare drive, programs like DataRescue may be able to grab a few files off it -- or maybe not.

  • Can not delete data from table which is queried in my stored procedure

    Hi,
    Anyone knows how to fix it:
    I have a table. In a stored procedure, I have a simple query running on this table.
    When I want to delete one record from that table, I got error message:
    ORA-04091: table *** is mutating, trigger/function may not see it.
    Thanks first.

    Rick, the only time you should get a mutating table error is when a trigger is involved. FK problems have separate error codes (and would be a different problem than the one that started this thread). Using a DBA id check all the tables subject to DML by your function and by whatever calls your function for triggers. Only the owner or a DBA can see the existence of triggers on a non-owned table. This has caused some of the developers I work with to think tables that had triggers do not have them since they do not work under the owning or a DBA ID.
    By your description of what you are trying to do in the function we do that all the time without problem.
    How large is the function? How/When is it called?
    Mark D Powell

  • How to retrieve data from a MSSQL?

    Dear All,
    How can I retrieve data from a MSSQL server in my custom iView which is developed by Eclipse?
    Thanks
    Sam

    Hi Sam,
    you have a bunch of possibilities... (and they do not really differ from accessing a DB from within any J2EE app).
    You can use a direct connection, setting Database, port, user, ... within your component.
    Or you can set all these things within VisualAdmin and then reference the DataSource via JNDI from within your component.
    You can directly use SQL.
    Or you can use ObjectRelationalMappers like Hibernate...
    Any more questions?
    Hope it helps
    Detlev

  • How to retrieve data from a field of CLOB datatype?

    How can I retrieve data from a field of CLOB datatype in Oracle
    8 being called from an ASP or VB application? The recordset
    object in ASP or VB doesn't support the CLOB datatype.
    Thank you in advance for your help.

    How can I retrieve data from a field of CLOB datatype in Oracle
    8 being called from an ASP or VB application? The recordset
    object in ASP or VB doesn't support the CLOB datatype.
    Thank you in advance for your help. Hello.. were you able to solve your problem? I'm faced with pretty much the same task.. I have a VBA application that needs to pull various pieces of data(CLOBs, BLOBs, etc..) from an Oracle8i db.

  • Problem retrieving Data from a CDATA-Section using XMLDOM

    Hello,
    Ware: Oracle 8.1.7.4 64bit, XDK for PL/SQL Version 9.2.0.3, Solaris8 64bit
    I can't retrieve Data from the CDATA-Section of an XML-String, neither with
    getData(DOMCharacterData) or substringData. Also getLength fails. I get always
    the following error:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.ClassCastException
    ORA-06512: at "XML_SCHEMA.XMLCHARDATACOVER", line 0
    ORA-06512: at "XML_SCHEMA.XMLDOM", line 853
    ORA-06512: at "SCHWABE.XML_TEST", line 47
    ORA-06512: at line 1
    I can successfully cast the DOMNode to a CharacterData with makeCharacterData
    and check with isNull (DOMCharacterData) (returns FALSE).
    My Testcase:
    1) A Function which build a XML-Document:
    CREATE OR REPLACE FUNCTION XML_ResponseCalc RETURN VARCHAR2 IS
    doc VARCHAR2(32767);
    BEGIN
    doc :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <RSDecEng>
    <Version>1.00</Version>
    <ResponseCalc>
    <ID>00000000000000000014</ID>
    <Burst>
    <Definition>
    <Count>1</Count>
    <ID>
    <Start>1</Start>
    <Length>4</Length>
    </ID>
    <Var>
    <Name>Risiko_1</Name>
    <Start>5</Start>
    <Length>5</Length>
    </Var>
    </Definition>
    <Data>
    <Length>9</Length>
    <Count>5</Count>
    <![CDATA[
    1 0.001
    2 0.002
    3 0.003
    4 0.004
    5 0.005
    6 0.006
    7 0.007
    8 0.008
    9 0.009
    10 0.010
    ]]>
    </Data>
    </Burst>
    </ResponseCalc>
    </RSDecEng>
    2) The Procedure which parses the XML-Document (no Exception-Handling):
    CREATE OR REPLACE PROCEDURE XML_TEST IS
    Parser XML_SCHEMA.XMLParser.Parser;
    DOMDocument XML_SCHEMA.XMLDOM.DOMDocument;
    DOMNode XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeItem XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeList XML_SCHEMA.XMLDOM.DOMNodeList;
    DOMCharacterData XML_SCHEMA.XMLDOM.DOMCharacterData;
    TheDocument CLOB;
    ID VARCHAR2(100);
    Data VARCHAR2(200);
    BEGIN
    -- LOB
    DBMS_LOB.CREATETEMPORARY(TheDocument, TRUE);
    DBMS_LOB.WRITEAPPEND(TheDocument, LENGTH(XML_ResponseCalc), XML_ResponseCalc);
    -- Parse
    Parser := XML_SCHEMA.XMLParser.NewParser;
    XML_SCHEMA.XMLParser.ParseCLOB(Parser, TheDocument);
    DOMDocument := XML_SCHEMA.XMLParser.GetDocument(Parser);
    XML_SCHEMA.XMLParser.FreeParser(Parser);
    -- Node
    DOMNode := XML_SCHEMA.XMLDOM.MakeNode(DOMDocument);
    -- Get ID
    DOMNodeList := XML_SCHEMA.XSLProcessor.SelectNodes
    (DOMNode,'/RSDecEng/ResponseCalc/ID/text()');
    IF XML_SCHEMA.XMLDOM.GetLength(DOMNodeList) > 0 THEN
    DOMNodeItem := XML_SCHEMA.XMLDOM.Item(DOMNodeList, 0);
    XML_SCHEMA.XMLDOM.WriteToBuffer(DOMNodeItem, ID);
    SYS.DBMS_OUTPUT.PUT_LINE ('ID: '||ID);
    END IF;
    -- Get CDATA
    DOMCharacterData := XML_SCHEMA.XMLDOM.MakeCharacterData(DomNode); -- <-- ok here...
    IF NOT XML_SCHEMA.XMLDOM.isNull (DOMCharacterData) THEN -- <-- ...and here
    Data := XML_SCHEMA.XMLDOM.GETDATA(DOMCharacterData); -- <-- ...but here Exception raise
    END IF;
    END;
    I hope you can help me.
    Thank you in advance
    Markus Schwabe

    You need to notice the definitions for makecharacterdata:
    FUNCTION makeCharacterData(n DOMNode) RETURN DOMCharacterData;
    PURPOSE
    Casts given DOMNode to a DOMCharacterData
    It only do the casting.

  • How do i retrieve data from a powerbook whose screen lights up but displays nothing? I have a firewire and a second powerbook...

    how can I retrieve data from my old powerbook? It's screen lights up, but displays only pixelated blankness. I have a second powerbook and a firewire cable....

    It would probably be correct to assume that both PowerBook computers are equipped with FireWire. The article below could possibly be of interest to you. With a bit of luck, the old computer will be recognised.
    http://support.apple.com/kb/HT1661
    Otherwise, it may become necessary to open the old PowerBook and remove the hard drive. The drive can then be connected to an appropriate external USB adapter, and read via another Mac.
    Jan

  • How to retrieve date from a set type in SAP CRM in BRF+ application

    Hi,
    Can anybody please let me know how can I retrieve date from a set type in SAP CRM to BRF+.
    I need to process the data in BRF+ and then send it back to CRM. Thanks.
    Regards
    Yogesh

    Hi Manish,
    From my experience, you cannot change an existing attribute of a set type (esp. when it has a dependency).
    You need to delete the attribute, save the changes and then re-create the attribute with new value table.
    Also remove any dependencies before deleting the attribute.
    Regards,
    Vartika

Maybe you are looking for

  • Slow start-up of Emulator in Linux

    When I try and run the phone emulator, it takes a long time (>5 minutes) to start up. I've got the 2.2 toolkit which came with the NetBeans 4.0 mobility pack, running on SuSE Linux 8.2 on a Pentium III, 1GHz with 384mb of RAM. I have Java 1.4.2_05. T

  • Is it possibil that user can create themselve in ABAP via browser ?

    Is there a possibility to create users in sap automatically via browser or else? Because I want that user can create themselve via browser.

  • Abap quick viewer (tcode sqvi)

    Hello friends,                    can any1 provide me with some links on abap quick viewer (tcode sqvi). links where i can learn how to use it.             thnks

  • Error when using OID in Jazn

    Hi, I am trying to use OID for J2EE Security and using oracle.security.jazn.oc4j.JAZNUserManager. I tried to use XML as the provider and it worked,but when I tried to use OID for the same,it failed. (entry in orion-application.xml)      <jazn     pro

  • Cannot install reader x

    When ever I try to install reader x i get to the following status  registering modules      file authplay.dll, file C:\proga...\ It has been sitting at this point for almost an hour. AdobeARM log has the following [2011-06-25 07:56:33] Adobe ARM 1.5.