Can i use array.count in line?

All,
I have one small oracle program that take a ',' separated string as an input
and assigns the individual string to a nested table.
I am wondering if I can directly use array.count in my sql below
instead of assigning the count of the array 1st and then
using it.
l_cause_codes_array := util_pkg.tokenize_string(p_cause_codes_csv, ',');
l_count := l_cause_codes_array.count;
My current sql:
delete from po_complaint_cause p
where p.po_number = p_po_number
and p.comp_code = p_comp_code
and l_count > 1;
I would like to do something like:
delete from po_complaint_cause p
where p.po_number = p_po_number
and p.comp_code = p_comp_code
and l_l_cause_codes_array.count> 1;
I just want to reduce one context switch if possible.
Thanks.

Hi,
did it give an error? Did you try? But it is possible.
But why not the next code:
  l_cause_codes_array := util_pkg.tokenize_string(p_cause_codes_csv, ',');
  if l_cause_codes_array.count >1
  then
    delete from po_complaint_cause p
    where p.po_number = p_po_number
    and p.comp_code = p_comp_code
  end if;Do only the delete if it is bigger than 1, that is I think the fastest switch.
Herald ten Dam
http://htendam.wordpress.com

Similar Messages

  • Can I use box-counting method to calculate fractal dimension in Photoshop CS6?

    Can I use box-counting method to calculate fractal dimension in Photoshop CS6?

    If you have a thresholded image, then you can use the mosaic filter and histograms to count coverage.
    Iterate with mosaic at different sizes, use the histograms to see how many are black and white at east mosaic size.
    Or resize the image, re-threshold, and again use the histogram to get a count.
    That should be automatable with a script.

  • How can I use word count without it counting the words in the end notes by default?

    How can I use word count without it counting the words in the end?
    Now I have to highlight the text to get a count.

    I don't think that is possible, it does what it does.
    Peter

  • How can I use a Counter in a Card 6601 for several times in the same VI

    When I try to use a Counter two times for read and for write, I get always a error (no. 50103). What should that mean.

    From the menu Help-->Explain Error...
    "The specified resource is reserved. The operation was completed by ignoring or overriding the specified resource."
    If you are using one particular counter for both read and write operations, you'll need to clear the read task before configuring the write task and vice versa. To clear the task in traditional NI-DAQ, pass in the task id to "Counter Control.vi" with a control code of 'reset'. When using DAQmx wire the task into "DAQmx Clear Task.vi".
    Do you really need to use the same counter in both a read and write mode at various times? Are the other three all tied up? Maybe I or someone else can help more if you describe the app and/or post some example code.
    -Kevin P.

  • What kind of devices/router series can be used to connecta leased line for a office of 50-60 users

    What kind of equipments, what series router can be used to connect a leased line,in  a office of 50-60 users,and the steps of setup and configurations in details,Condsider the budget also.
    what kind of port/interfaces are used to connect a lease line?
    I am novice in netwrking field,
    Kindly answers in detail.
    Correct answers are appreciated
    Regards
    Sudipto

    What is the WAN speed?

  • Can I use Array Binding with a ExecuteDataSet or ExecuteReader methods?

    I want to use Array binding with selects. From the examples that I see so far it seems like everyone is showing the ExecuteNonQuery method. I wonder if I can use this functionality with a regular query that returns ref cursoros.
    Andrzej

    what is the error you recieve?

  • Can I use my Skype On Line Number

    Can I use a skype USA On Line number to set up a skype to go as my country Thailand is not included in the skype to go countries to choose from

    jackinbangkok wrote:
    Can I use a skype USA On Line number to set up a skype to go 
    No. I'm afraid you can't do that.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • Can I use creative cloud off line

    I want to be able to use this product off line and not have to be that to get any work done have to go on line all the time.  Photographs that I work on belong to the customer and they should be able to feel that there is  no way that anyone besides myself has access to any worked on photograph

    This is a common thread amongst those who don't understand the Adobe CC product. It seems that Adobe is doing a poor job communicating what CC is and how it works.
    No, you do not need to be online to use CC. However, every 30 days (that is what it seems for me), CC will require a momentary validation connection but I understand that Adobe is planning to change this to once every 180 days.
    More importantly, with CC, you are *NEVER* required to share or save any of your CC produced work online.
    Basically, all the Adobe products and all the work you create reside on your local computer storage (or where ever you choose). Adobe does offer secure cloud storage, as part of your CC subscription. This is an excellent tool to save and share your content with others... and only those whom you invite are able to access this storage.
    I hope I have adequately answered your question.
    Shawn

  • How can i use numeric counter on a graph

    Hey guys,i need some help.
    I have 113 inputs and want to put a numeric counter to choose which input i want to see on graph.
    Can i do it?!
    Thank you all!!

    You have an array with the 7 different channels appended at 16 points each. Simply get the array subset based on the desired trace. Here's a simplified example.
    You can make the control a ring with the items named accirding to the channel names.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SelectSubsetTemperature.vi ‏88 KB

  • What function can be used to count the number of cells who have a specific string (i.e. "Blue")?

    I am attempting to gather information as to the makeup of the cars in a parking lot. I have already gathered data as the make, model, and color of the care on each car. How would I go about counting the amount of cells which 'red' or 'honda'?

    Do you know that iWork Formulas and Functions User Guide is not delivered to help users to help you ?
    So, download it and search for the keystring COUNT
    I bet that you will find quickly the functions COUNTIF and COUNTIFS.
    Yvan KOENIG (VALLAURIS, France) mardi 13 septembre 2011 16:29:14
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    When we wish to know, we question. When we want to be capable, we study.

  • Saving an array of multi-line text cells in a format that can be read in later

    I can create an array of multi-line text entries that my program can then pick cells and compile them into a list of text.
    I would like to be able to Save the array as a file, then change my program to read in the file.
    If I use the Save Spreadsheet file vi, the data is corrupted by the carriage returns within the cells and the data read in is messed up.
    Can someone recommend a way to save the array that preserves the carriage returns?

    As far as I know, this cannot be done automatically with the basic VIs from the palletes.  I would convert the [LF] into another group of characters (likely "\n") and then save the text array to a CSV file.  Don't forget to escape any good "\" string with an extra "\.  Regular expressions would work really well:
    Just make sure you parse your entire array of strings with this.
    Olivier
    Attachments:
    SaveToCSV_WithMultiLine.vi ‏9 KB

  • Using Arrays in SELECT BULK queries

    Dear All,
    Can we use arrays in the SELECT Bulk operations.
    Example:
    SELECT empno BULK COLLECT INTO v_empno FROM EMP WHERE deptno = v_deptno(m);
    Is there any way we can simulate this example.
    Appreciate your response on this one.
    Thanks,
    Madhu K.

    Yes you can. See the example.
    SQL> set serverout on
    SQL> declare
      2  TYPE varr_typ IS VARRAY(2) OF NUMBER;
      3  my_varr varr_typ:=varr_typ(20) ;
      4  TYPE rec_typ IS RECORD (fname EMPLOYEES.First_Name%TYPE,
      5                          lname EMPLOYEES.LAST_NAME%TYPE);
      6  TYPE tmp_tbl IS TABLE OF  rec_typ;
      7  my_tbl  tmp_tbl;                     
      8  BEGIN
      9  --my_varr(1):=20;
    10  SELECT FIRST_NAME,LAST_NAME
    11  BULK COLLECT INTO my_tbl
    12  FROM EMPLOYEES
    13  WHERE department_id=my_varr(1);
    14 
    15  FOR i IN 1..my_tbl.COUNT LOOP
    16    DBMS_OUTPUT.put_line(my_tbl(i).fname||' '||my_tbl(i).lname);
    17    END LOOP;
    18  END;
    19  /
    Michael Hartstein
    Pat Fay
    PL/SQL procedure successfully completed.

  • Custom code - count of lines

    Hi,
    How can I obtain the count of lines of code in all the custom objects such as z programs, z functions, z methods, user exits etc?
    THank you,
    Mike

    check fm RPY_FUNCTIONMODULE_READ
    Check how it reads the source code and returns it.
    Use a describe statement to the return table
    or try this syntax
    itab must hold a field of char72.
    READ REPORT 'Y123'  INTO ITAB.
    lines_r = lines( itab ).
    also check in se37 for rpy*
    Also check the f1 for read report, there are many other options

  • Can't use PayPal Credit on eBay.

    I noticed that I have $506 in PayPal Credit in my account. I tried to buy something on eBay and it said that it couldn't authorize my payment. I also tried to buy something on a different site and got rejected. Why is it showing $506 on the main page in  PayPal when I can't even use any of it?

    Same here, it is very frustrating.  I have a fairly new paypal credit account and can not use it. I Have spent hours on the phone with paypal credit and they can not tell me what is wrong.  They have checked all of my account info, and I have no balance (since I have never used it) and I have available credit.  When I try to use paypal credit I get a message saying the payment type you are using is not working, try another payment type.   They keep telling me it must be an internal system issue and to let the system calm down a few days and try again.   My wife has paypal credit and has used it with out any problems on the same computer so I know it is not a browser problem.  She can send money to my paypal account with no problem, and I can then transfer to my bank accoutn. I just can not use my paypal credit line!  No one can give me a solution. 

  • PCI 6602:How can I use the digital lines of the board and in the same time to generate pulse train using a counter?

    Hello!
    My problem appeared when I tried to update my code from Traditional NI-DAQ Legacy to DAQmx.
    I am using 2 counters (counter 5 and counter 7)  from PCI-6602, to generate pulse train, and also the Digital I/O lines of the port 0 (the lines form 0 to 7). What I do in my application is that I am starting to generate the pulse train on the output of the 2 counters, and after that I am playing with the state of the digital lines.
    In traditional there was no problem using the counters and the digital lines in the same time, everything was going perfectly, but in DAQmx this is not possible.
    What happens: I start to generate pulse train on the output of the counters,  no errors encountered, but when I try to modify the state of one line of the digital port the generation of the pulse train is stopped. This is happening when I start the task associated to the digital port.
    My question is: it is possible to create a channel on the digital lines without altered the channels created for the counters?
    Another thing what I manage to see using the  "Measurement & Automation Explorer" and Test panels for PCI-6602, basically is the same thing, I generate pulse train on the output of the counter 7 and try to start a task on the digital line, but I get one error :
    "Error -200022 occurred at Test Panel
    Possible Reason(s):
    Measurements: Resource requested by this task has already been reserved by a different task.
    Device: Dev4
    Terminal: PFI8"
    Instead if I use the counter 0 or counter 1 to generate pulse train I don't encounter the same problem.
    Which resources are used by the counters 2 to 7 from the PCI-6602 board and the counters 0 and 1 do not use?
    Thank in advance for any replies!
    Ciprian
    Solved!
    Go to Solution.

    Hello Jordan, thank you for your reply.
    I am sorry but I can not see or run your example, I don't use LabView, I use Visual C++ for developing.
    Here is the code for generating the pulse train:
    GeneratePulseTrain(unsigned long ulCount1, unsigned long ulCount2)
        short nStatus = 0;
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        nStatus = DAQmxCreateCOPulseChanTicks (m_taskHandle, "Dev4/count5", "", NULL, DAQmx_Val_Low, 0.0, ulCount1,ulCount2);
        if( bTriggerMode == true) // if hardware trigger is enabled
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Src,"Dev4/PFI17" );
        //set the internal timebase
        nStatus = DAQmxSetCOCtrTimebaseSrc(m_taskHandle,"Dev4/count5","20MHzTimeBase" );
        nStatus = DAQmxStartTask(m_taskHandle);
        return nStatus;
    And the code where I try to set the digital line:
    SetChannelState(short nState)
        short nStatus = 0;
        uInt8 wrtBuf0[1]={0};
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        // Configure line as output 
        nStatus = DAQmxCreateDOChan (m_taskHandle, "Dev4/port0/line0", "", DAQmx_Val_ChanPerLine);
        nStatus = DAQmxStartTask(m_taskHandle);
        wrtBuf0[0] = nState;
        nStatus =DAQmxWriteDigitalLines (m_taskHandle, 1, 0, 0, DAQmx_Val_GroupByScanNumber , wrtBuf0, NULL, NULL);
        nStatus = DAQmxWaitUntilTaskDone(m_taskHandle,10);
        nStatus = DAQmxStopTask(m_taskHandle);
        nStatus = DAQmxClearTask(m_taskHandle);
        m_taskHandle = 0;
        return nStatus;      

Maybe you are looking for