An effective way to check is a line

Hello

In PLSQL, what is the most effective way to check it is to a line before I delete the line? I prefer not to use the EXCEPTION to handle the case DATA_NOT_FOUND.

Thanks in advance!
Any exception maybe raised when I try to delete a row that does not exists? 

Nope

drop table my_table;

create table my_table as select level t_id from dual connect by level <= 10;

begin
delete from my_table where t_id = 100;
dbms_output.put_line(sql%rowcount||' rows deleted ');
end;
PL/SQL procedure succesfully completed
0 rows deleted

Tags: Database

Similar Questions

  • The most effective way to store lines

    DB version: 10gRel2 and 11G


    If I want to keep a single column as structure, I would like to use associative arrays for performance reasons. Who is the most effective method to store a multicolumn line?


    You guys are using something like this
    DECLARE
      type v_emprec_array is table of emp%rowtype INDEX BY BINARY_INTEGER;
      v_emprec v_emprec_array;
    BEGIN
      select * bulk collect into v_emprec from emp where empno=7369;
    or this
     declare
      TYPE rec_UpdateEmp IS RECORD
               (
              Inpt_emp_id         t_InptId,
              Stat_Code               gt_StatCode,
              Tms_Proc                pa_TmsProc,
              Tms_Po_Flag             pa_TmsPoFlag,
              Sngl_Unit_Flag          pa_SnglUnitFlag,
              Pkt_Profile_Id          gt_ProfileId,
              Pkt_Type                pa_PktType,
              host_inpt_id            pa_HostInptId
              );
              
          rec                         rec_UpdateEmp;
      

    Ref Cursor is a better option

    create or replace procedure emp_dtls
    (
     p_sal number,
     p_result out sys_refcursor
    )
    as
    begin
     open p_result for
      select ename,sal from emp where sal>p_sal;
    end;
    /
    
    SQL> var myvar refcursor
    SQL> exec emp_dtls(2000,:myvar);
    
    PL/SQL procedure successfully completed.
    
    SQL> print myvar
    
    ENAME             SAL
    ---------- ----------
    JONES            2975
    BLAKE            2850
    CLARK            2450
    SCOTT            3000
    KING             5000
    FORD             3000
    ADAMS            7654
    
  • Fastest way to check if a file exists

    Hello

    I have a table with more than 100 M records. What is the fastest way to check if a record exists or not. Currently I use Oracle 11.2. Here is the SQL code I used, id is the primary key of the table_test.

    Select count (*) from existFlag
    of table_test
    where id = testID
    ;

    Yes, you could use double fusion using the clause, but a line of K + 10 k 10 inserts a line MERGE statements will be much less effective than 1 INSERTING rows 10 K + 1 MERGER of 10 K lines.

    SY.

  • The most effective way to retrieve a number of virtual machines in an org?

    Hi all, what is the most effective way to retrieve a MV of County in an org. I am currently recovering all CDV in an org, then all the vApps, then all of the virtual machines and pushing them into a table, then do a vms.length on the table filled by all virtual machines.

    It takes a horrible time, and there MUST be a better way.

    Open to any suggestion. Thank you

    Good, as administrator of the organization then: (I have not tried as a normal user account)

    var vdcs = new Array();
    var orgVMCount = 0;
    var vcdHost = org.getHost();
    
    var queryService = vcdHost.getQueryService();
    var expression = new VclExpression(VclQueryOrgVdcField.ORGNAME, org.name, VclExpressionType.EQUALS);
    var filter = new VclFilter(expression);
    var params = new VclQueryParams();
    params.setFilter(filter);
    
    var resultSet = queryService.queryRecords(VclQueryRecordType.ORGVDC,params);
    while (resultSet != null) {
    
        var records = resultSet.getRecords(new VclQueryResultOrgVdcRecord);
        for each (var record in records) {
            var vdcVMCount = getVdcVMCount(record.href, vcdHost);
            System.log("VDC "+record.name+" VM Count: "+vdcVMCount);
        }
        orgVMCount += vdcVMCount;
        resultSet = resultSet.getNextPage();
    }
    System.log("Total Organization VM Count: "+ orgVMCount);
    
    function getVdcVMCount(vdcHref, host){
        var vmCount = 0;
    
        var qs = host.getQueryService();
        var exp = new VclExpression(VclQueryVMField.VDC, vdcHref, VclExpressionType.EQUALS);
        var exp2 = new VclExpression(VclQueryVMField.ISVAPPTEMPLATE, false, VclExpressionType.EQUALS);
        var exps = new Array(exp,exp2);
    
        var expFilter = new VclFilter(exps,VclFilterType.AND);
        var queryParams = new VclQueryParams();
        var vmArray = new Array();
        queryParams.setFilter(expFilter);
        var rs = qs.queryRecords(VclQueryRecordType.VM,queryParams);
        while (rs != null){
            var vmRecords = rs.getRecords(new VclQueryResultVMRecord);
            vmCount += vmRecords.length;
            rs = rs.getNextPage();
        }
        return vmCount;
    }
    

    It takes a little more code because the ".ORG" field is not available for the non-Admin queryVMField, but the. VDC IS, so we start by retrieving the TDC for the Org, then for each one, ask the number of vm for VDC.

    Post edited by: Burke - had accidentally initialization of orgVMCount as new Array(); -changed second line to 'var orgVMCount = 0;

  • The most effective way to import data from Excel in InDesign?

    Hi all

    I'm designing for a prospectus of college which includes 400 + courses list. For the moment, these lists exist as a huge Excel sheet with fields such as course type, course code, description, etc.

    I am familiar with Excel data import in InDesign and the tables/creation of table styles and other formatting, but the problem I have is that the data are in several columns by courses in the Excel worksheet, but will be in a single column per course with several lines in the InDesign document. I can't find a way to easily convert these columns in lines.

    Someone can help me with an effective way to get the data in the page layout without laborious copying and pasting or formatting?

    Thanks in advance!

    Hello

    In excellent paste / transpose

  • Is there a more effective way to interrogate this cache?

    I have an interesting dilemma that I don't know how to fix. I have a cache of objects ClientType (see below). I'm trying to find the CustomerGroups that contain a password key for the customerValues card, which also have a CustomerValue.value between a high and low value. In others, do me all the CustomerGroups who have a client of "101" code, which contains a CustomerValue between 50 and 250. I have this fine work to aid request a customer filter - but the problem I have is that the cache contains approximately 500,000 items. The research must be applied to all objects, and because most of the clients contain a customervalue - we end up deserialization of objects to perform the comparison of the value in the cache that fills the eden space so quickly (in a multi-threaded env) that we are to throw himself into the holder space. This causes performance issues because it weakens the large global catalogs. We use 3.5.2 consistency and all are active POF. The works of current query - I'm looking for the most effective way to do with respect to the use of time and lot. I am willing to trade increased Rightsizing memory use for best performance - which means the addition of index / improves the news is very good. The big problem is fill the eden space so quickly. Any ideas?
    class CustomerGroup
    {
        Set<Customer> customers ;
    }
     
    class Customer
    {
        Map<Integer, CustumerValue> customerValues;
    }
    
    class CustomerValue
    {
      private int value ;
      private boolean isNew ;
    }

    Simi74 wrote:
    Robert - appreciate the help. The question I have for this juicer is that the price is related to a specific customer. For example:

    ClientType contains 1 client.

    This customer has 2 CustomerValues in his card.

    These entries to resemble the following:

    Key: 100
    Value: CustomerValue.value = 10
    
    Key: 200
    Value: CustomerValue.value = 50
    

    If I'm following your logic, the extractor that you recommended would apply to values (that is to say, 10, and 50). So, if I searched for CustomerGroups that have values between 5 and 15,
    return the ClientType as one of the values is 10. However, I also this map to a specific client code (in this case either 100 or 200 - they key in the matching values). Thus, the query is really more like 'give me all the objects ClientType to 100 client code where the value is between 5 and 15'. I should only get this object if the client code is 100. I can't do a ContainsFilter with the client code and use BetweenFilter because using an AllFilter since this logic would be tantamount to a 'false' positive press 200. Logical in this case being 'the ClientType contains a 200 client' who is true and does the ClientType contain a value between 5 and 15, which is also true, because the value list has 10 and 50. But it must return this object ONLY if the customer key passed is 100. The example below is a false positive.

    /* following code returns the object, but should not! */
    Filter[] filterArray = { new ContainsFilter( new CustomerKeyExtractor(), new Integer( 200 ) ),
    new BetweenFilter( new CustomerValueExtractor(), 5, 15) };
    
    Filter filter = new AllFilter( filterArray ) ; 
    

    So my question is how to apply a hint on the CustomerKey/CustomerValue as a whole without deserialize all the objects for each search? Or is it a problem with the structuring of the object? If that's the problem - of recommendations on alterations are welcome as well fix this filtering.

    Ah, ok, got it now...

    What is the client code?

    Is it just a key generated with an arbitrary value, or is it a thing of enum type (key to a value of metadata property with only a finite number of different property names, etc.) with only a small number of different codes in all of the cache?

    If it's a thing of enum type, then instead to extract only the 'value' s as integers, you can extract pairs ' value: code "represented as long with the code being the high 32 bit which would be always classifiable and allow querying: instead of valueMin and valueMax, you would code: valueMin and code: valueMax as the beach.

    If it's an arbitrary generated value, then it is a bit more problematic (extraction POF does not support crossed down in individual map entries, so it can't be indexed without the plan, including the entire Customer objects to deserialize), but I wouldn't address that if it is not necessary, so please indicate if the previous approach fits your needs :). In the case that it is not, you would probably want to the extracted value to be structured on the other hand, the value is the code and 32-bit higher at least 32. You must also write a custom filter that supports the index which is able to use this index going in the direction of Alexey BetweenFilter but with additional controls for the code... In addition, you must check whether the consumption of memory of the filter can be too high...

    Best regards

    Robert

  • What is the best way to check the data

    What is the best way to check the actual changes in the data, i.e., to be able to see each insert, update, delete on a given line, when it happened, who did it, and what looked like to the front row and after the change?

    Currently, we have implemented our own audit infrastructure where we generate standard triggers and an audit table to store the OLD (values at the beginning of the Timekeeping point row before) and NEW (values at the beginning of the point of timing after line) values for each change.

    I put this strategy due to the performance impact there (important say least) and because it's something that a developer (confession, I'm the developer) came with, rather than something is a database administrator came with. I looked in the audit of the Oracle, but it doesn't seem like we would be able to go back and see what a line looked like at some point in time. I also watched flashbacks, but this seems like it would take a monumental amount of storage just to be able to go back a week, much less the years currently keep us these data.

    Thank you
    Matt Knowles

    Published by: mattknowles on January 10, 2011 08:40

    mattknowles wrote:
    What is the best way to check the actual changes in the data, i.e., to be able to see each insert, update, delete on a given line, when it happened, who did it, and what looked like to the front row and after the change?

    Currently, we have implemented our own audit infrastructure where we generate standard triggers and an audit table to store the OLD (values at the beginning of the Timekeeping point row before) and NEW (values at the beginning of the point of timing after line) values for each change.

    You can either:
    1. set up your own audit custom (as you do now)
    2 flashback Data Archive (11 g). Application for licence.
    3 version check your tables with Workspace Manager.

    >

    I put this strategy due to the performance impact there (important say least) and because it's something that a developer (confession, I'm the developer) came with, rather than something is a database administrator came with. I looked in the audit of the Oracle, but it doesn't seem like we would be able to go back and see what a line looked like at some point in time. I also watched flashbacks, but this seems like it would take a monumental amount of storage just to be able to go back a week, much less the years currently keep us these data.

    Unfortunately, the audit of data always takes a lot of space. You should also consider the performance, as custom triggers and Workspace Manager will perform much slower than the FDA if there is heavy DML on the table.

  • Effective way to create an online help for different users

    Hello

    I use RH6 (RoboHelp HTML) on Windows XP to create WebHelp. I need to create an online help for 3 different users, for example, student, teacher and principal. Some functions of the software are available based on the permissions assigned to users. So, I developed a main project file ("All.xpj") that contains all the topics. Then I create a new project for each type of user and import only the topics that relate to the user. It is the most effective way? I didn't have to create 3 or 4 conditional parameters... because I would have to re - create the table of contents, the Index, and the Glossary for each project. It is the most effective way to use RH6 for my needs?

    Any advice or suggestions would be greatly appreciated.

    Thank you
    FMnRH

    Conditional compilation marking would go like this:
    1 mark the topics specific to the user as a 'Student', 'Teacher' or 'Major', as the case may be.
    2 leave unidentified all subjects that are common to all.
    3. Enter the three configurations different single source (SSL):
    -L' SSL must have the term generation student NOT a teacher AND NOT Principal.
    -L' SSL must have the term generation NOT a student teacher AND NOT Principal.
    -The main SSL should have the term generation NOT student AND NON-teaching.
    All unmarked topics will appear in the output.
    4. the table of contents can be trickier; It depends on your structure. Tag user specifi c-books in the table of contents as a student, teacher or Director. Let the unidentified current material. Do the absolute minimum marking here that you can get away with and try to keep the simple tags and high level. It is too easy to lose them in a table of contents complex. The thing to remember here is that if a topic is not in the output, it will be automatically excluded from the table of contents. This means that if you have marked a topic as a teacher, he will not be displayed in the table of contents of the student, even if you do not expressly exclude the table of contents entry.
    5. as a result of the reasoning in number 4 above, the index should take care of itself, and I think that the glossary will be, too, although I have not played with glossaries a lot.

    -----------------------

    I think you have the right idea on how to perform the merge. I don't have access to HR right now to check.

    If all three projects have the same definitions in the glossary, put them in the common project of the child, not duplicate them in the user-specific projects.

    HTH,
    G

  • Is there a way to check out FF as the TWO webroot security and now my Bank has sent a security notification that my Firefox is not secure and can be redirected elsewhere.

    "ACTIVE PROCESS Firefox.exe has a POSSIBLE MEMORY LEAK"

    When I run an Analyzer system for WEBROOT the statement that there is a breach of security for my Firefox browser.
    When I went to access my Bank info, I get a message that redirects to a site with an invalid certificate Firefox.
    Is there a way to CHECK to see if I have a secure copy of Firefox? (Yes, I have installed through the main site.

    I TEACH technology to the public school system and have high security that updates regularly and my pc runs so regular maintenance.

    Are there addons strangers, and do a malware check with some different programs, unless that Webroot is striking firefox on a memory leak, it was 2 years ago.

  • Is there a way to check the status of the battery on an iPad 4gen?

    Is there a way to check the status of the battery on my iPad 4gen?

    Make a booking Genius Bar at your local Apple store and they can run a free diagnostic on the iPad that will determine the State of the battery.

    You will need for your Apple ID to make the reservation:

    http://www.Apple.com/retail/Geniusbar/

  • 10.10.5 running.  Is there a way to check if my system has a virus?  I was surfing and a message 'the last page you have open infected your system with a virus.  ' Click on continue fixing your system.

    I am running 10.10.5 OS on a Macbook.  While surfing, I got a message "last page you have open infected your computer with a virus.  Click here to clean the virus. "It appeared to come from Apple but aware that this message could be the virus.  Is there a way to check my system for a virus, or what I do check at an Apple reseller or a store?

    The message is a scam.  There is no virus for osx.

  • The simplest way to draw a vertical line on Panel

    Hello

    I wonder what is the easiest way to draw a vertical line? Could you give me an example?

    Thank you

    Ah, what selection of control chose one vertical

  • What is the best way to check if the trigger was held

    What is the fastest way to check if the trigger was held. Right now, the only way I can think is to query the number of samples acquired on the AI channel (which is triggered). Is there a faster way? Is there a property node (that I can't find) that returns TRUE/FALSE?

    Thank you

    Can you elaborate a bit more? What type of trip (I guess a start trigger)? What equipment? What do you mean by 'faster '?

    There is no property to "has a start trigger has occurred." If you want to find if a start trigger has occurred, you can he deduct the number of samples. There are several approaches you can take:

    * DAQmx Read will hang until a timeout is hit or up to the number of samples you request is read. You could do a DAQmx Read with a timeout-infinity (1), playback of a single sample.

    * Well, you could ask about properties DAQmx Read TotalSampPerChanAcquired or AvailSampPerChan; Once they no longer means 0, while this NEITHER-DAQmx started buffering data internally, which means that the material received the trigger.

    * If you use a digital border start trigger and according to your material, then you may be able to use the detection of changes in a separate task, but I don't know if it would be significantly faster then the other two approaches.

  • Effective way to draw a selected graphic user

    Hello

    I channel data acquisition "n" and I need to graph data, but the channel is selected by the user. For channel 1, channel 2 or it can for example select channel 1 and 2. I have a solution to what use cases multiple structures which I know is not the best way to do it. Is there an effective way to do it. Can someone tell me a knowledge base

    I have attached the jpg to know how I do this.

    Thanks in advance

    Nitin

    You also have the visibility available field box when you view the legend of the plot. It's also can be defined by a property node.

  • The most effective way to log data and read simultaneously (DAQmx, PDM) high data rates

    Hello
     
    I want to acquire the data of several Modules cDAQ using several chassis to
    high data rates (100 k samples per second if possible). Let's say the measurement time is 10 minutes and we got a large number of channels (40 for example). The measured data is written to a PDM file. I guess, the memory or the HARD disk speed is the limits. For the user, there must be a possibility to view the selection of channels in a graph during the measurement.

    My question: what is the best and most effective way to save and read data at the same time?

    First of all, I use an architecture of producer-consumer and I don't want to write and display the data in the same loop. I expect two possibilities:

    [1] to use the 'DAQmx configure logging.vi' with the operation 'journal and read' to write the data to a PDM file. To display the data in a second loop, I would create a DVR samples documented and 'sent' the DVR for the second loop, where the data will be displayed in a graph (data value reference). This method has the disadvantage that the data of all channels is copied into memory. Correct me if I'm wrong.

    [2] use 'DAQmx configure logging.vi', but only with the "journal" operation to write the data to a PDM file. To view the selected data, I had read a number of samples of the TDMS file in the second loop (I'm currently writing the TDMS file). In this case, I have only one copy data from the selected channels (not), but there will be more HARD drive accesses necessary.

    What is the most effective and efficient solution in this case?

    Are there ways to connect and read data with high frequencies of sampling?

    Thank you for your help.

    You say that the measurement time is 10 minutes. If you have 40 channels and you enjoy all CHs at 100 kHz, it is quite a number of values.

    In this case, I always try to approach under the conditions of use. If a measure is only 10 minutes, I just connect all PDM data and create a graphic module that could be in the same loop of consumers where connect you the data. You can always work on the raw data files big offline afterwards, the extraction of all the information you need (have a look at the product called NI DIAdem: http://www.ni.com/diadem/)

    The main issue is that the user needs to see in the graph (or perhaps a chart can be useful too). Lets say that the graph is 1024 pixels wide. It makes no sense to show multiple data to 1024 points, Yes? Every second will produce you 100 data points k per channel. What is the useful information, which should see your username? It depends on the application. In similar cases, I usually use some kind of data reduction method: I use a moving average (Point by point Mean.VI for example) with a size of the interval of 100. This way you get 100 data points of 1000 per channel every second. If you feed your graph every second with these average values, it will be able to data points in 1024 of the store (as a default) by channel (curve), which is a little more than 10 minutes, so that the user will see the entire measurement.

    So it depends on the frequency at which you send data to the consumer. For example, collect you values 1024 by iteration of the producer and send it to the consumer. Here you can make a normal means calc or a bearing (according to your needs) and he draw a graphic. This way your chart will display only the values of the last 10 seconds...

    Once I programmed some kind of module where I use a chart and not a graph, and the user can specify the interval of the absolute timestamp that is traced. If the data size is larger than the size of the chart in pixels, the module performs an average calculation in order to reduce the number of data points. Of course, if you need to see the raw data, you can specify an interval that is small. It all depends on how you program zoom functions, etc... In my case I hade a rate of 1 Hz, so I just kept all data in RAM limiting the berries to keep 24 hours of data, so that technicians could monitor the system. In your case, given the enormous amount of data, only a file read/write approach can work, if you really need access to all of the RAW data on the fly. But I hope that the values of working capital means will be enough?

Maybe you are looking for

  • ReadyNAS 6.5.0 legacy (Pro6) have stability problems?

    Hi guys,. I am running 6.2.4 without no stability problem on my Pro 6 and I would like to know if anyone has tried 6.5.0beta2 on Pro6. I luck was lowered from 6.4.1 causing very great stability on my Pro6 (blocks, freeze...) problems 6.2.4 seems rock

  • STOP 0x000000A goes to stanby

    every time, when I try to put my XP mode standby, the blue screen of death with 0x000000A with different parameter comes. the machine can turn off fine.  It is only when I put on standby.  no radical change in the software or newly installed, it just

  • I can't turn on my Windows Defender, a program called RegClean is stop with error 0x800750b4 windows defender is disabled

    How a turn on Windows Defender and to get rid of RegClean, reg is the troublemaker? I have a microsoft account, don't know why I need a live account? My and password

  • Anyway to get around using windows default mail under vista?

    I tried all the things. I use craigslist all the time and when I try to meet someone on here it opens a new window for windows mail. I want to open a new window with yahoo mail since this is the email that I use. I'm only using regular mail not liked

  • I can't find Restore Points

    OK I got my Pc for 11 months and he went recently I've manged to get an old PC with XP on it and add all my old stuff but when I start with the Vista HD TI do not work, I tried everything and can't get it to work if anyone knows the number of LogiQ I