Help in using COUNT(*)

Hi everyone,
pls see the query given below
select
bank_code as "Bank Code "
, e.rep_prd as "Reporting Period"
, e.act_prd as "Actual Period"
, e.nrd_sch_id as "N.R.D.Scheme Code"
, e.ac_type_id as "Account Type"
, e.ac_cat as "Category of account holder"
, e.org_mat as "Original maturity"
, e.res_mat as "Residual maturity"
, e.swift_code as "Swift code"
, e.nrd_ccy_id as "Account currency swift code"
, e.nrd_rec_type_id as "Record type code"
, e.rec_amt as "Record amount"
from rm_nrd_csr e
group by ac_type_id
in the second last row where it is blank, i need to display the number of accounts that are available for each account type, how do i modify the query ? how do i add count in the last column to display number of accounts ?

Hi,
872435 wrote:
its giving an error "not a GROUP BY expression"Remember the ABC's of GROUP BY:
When you use a GROUP BY clause and/or an aggregate fucntion, then item in the SELECT clause must be:
(A) an <b>A</b>ggregate function,
(B) one of the "group <b>B</b>y" expressions,
(C) a <b>C</b>onstant, or
(D) something that <b>D</b>epends entirely on the above. (For example, if you "GROUP BY TRUNC(dt)", you can "SELECT TO_CHAR (TRUNC(dt), 'Mon-DD')").
In your query, there are 13 items in the SELECT clause, but only 1 of them meets the conditions above. Perhaps you don't want to use GROUP BY at all, or you want to add all the other columns (except the COUNT (*)) to the GROUP BY clause, in which case you wou use the aggregate COUNT function, not the analytic function that LPS posted.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
Explain how you get those results from that data.
Always say what version of Oracle you're using.

Similar Messages

  • Any idea why in Numbers my COUNTIFS formula keeps breaking? For daycare purpose, I use a spreadsheet that helps me to count how many children I have at 3:15, 4:15 and 5:00. COUNTIFS works well when I create it but breaks after a while. Also I am using a p

    Any idea why in Numbers my COUNTIFS formula keeps breaking? For daycare purpose, I use a spreadsheet that helps me to count how many children I have at 3:15, 4:15 and 5:00. COUNTIFS works well when I create it but breaks after a while. Also I am using a pop-up menu in the cells in time format, does it have any consequence on the formula?

    Any idea why in Numbers my COUNTIFS formula keeps breaking? For daycare purpose, I use a spreadsheet that helps me to count how many children I have at 3:15, 4:15 and 5:00. COUNTIFS works well when I create it but breaks after a while. Also I am using a pop-up menu in the cells in time format, does it have any consequence on the formula?

  • Urgent : Flash CC File is corrupted, symbol (movie clip) are empty, use count : 0 . ONE week of work lost, need help!

    Hello,
    I have been working on a Flash File with a lot of animations / symbols etc, and on thursday (during the Adobe Update), when I opened my file, all the symbol (movie clip) are empty, use count : 0.
    The size of the file is still the same though, 35mo.
    I had only this file, I really need help to repair it...
    Please let me know if you have a solution.
    Thank you!

    hi,
    Can you please share the file which got corrupted?
    Was the original file created in older version(CS6 and below) of Flash?
    Were you trying to open the file in Flash CS6?
    Did your original file had symbol names containing | : ; & * , etc.characters or leading/trailing spaces?
    Rgds,
    Mukesh

  • I have to use count function  in "if-else" condition in rtf tempelate

    I have a nedd to use count fucntion in my rtf fucntion in IF-ELSE condition like this :
    if
    (count INVOICE_LEVEL from xml where (INVOICE_LEVEL=SM_SUMMARY_LEVEL)) =  (count coloumn_A from xml ) --- if the count matches
    THEN print "NO DATA FOUND"
    else --- if not
    end if ;
    --------XML------
    <COMP123>
       <SM_SUMMARY_LEVEL>2</SM_SUMMARY_LEVEL>
      <SM_CHARGE_HEAD>2</SM_CHARGE_HEAD>
      <INVOICE_LEVEL>2</INVOICE_LEVEL>
      <RCVR_ADDRS3_PART1>SG</RCVR_ADDRS3_PART1>
      <RCVR_ADDRS3_PART2>ASIA ,</RCVR_ADDRS3_PART2>
      <TXN_CSTMR_REF>ABC-DEF</TXN_CSTMR_REF>
      <TAX_ID>PCT-ID</TAX_ID>
      </COMP123>
    <COMP123>
       <SM_SUMMARY_LEVEL>2</SM_SUMMARY_LEVEL>
      <SM_CHARGE_HEAD>2</SM_CHARGE_HEAD>
      <INVOICE_LEVEL>2</INVOICE_LEVEL>
      <RCVR_ADDRS3_PART1>SG</RCVR_ADDRS3_PART1>
      <RCVR_ADDRS3_PART2>ASIA ,</RCVR_ADDRS3_PART2>
      <TXN_CSTMR_REF>ABC-DEF</TXN_CSTMR_REF>
      <TAX_ID>PCT-ID</TAX_ID>
      </COMP123>
    can any one help me to write the correct syntax and logic for this .
    THANKS!

    I am using the below way but it is not working as desired it is always printing the derived value.
    <?xdofx:if (xdofx:round((to_number(to_char(SYSDATE,'JSSSSS'))-to_number(to_char(to_date(DOB_DATE, 'YYYY-MM-DD'),'JSSSSS'))) div 100000)) <= 30 then '(1-30)' else '(1-100)' end if?>
    Let me know if i missed anything..
    Thanks,
    Jana

  • How to use Count with Date Parameters

    Hello,
    I am having issues using the Count() function in conjunction with date parameters.
    This is a Siebel report and in my report I have 2 date parameters(From Date, To Date). In a nutshell I am basically trying to count Opportunities that has a start date within the given date period. However I don't see a reasonable way to put my date parameters within the Count() function. The reason being is that I need to have a huge chunk of code to convert the dates into a common format that can be compared, and it won't even fit within the code block in my rtf template. I am not even sure how to put multiple conditional statements inside a Count() function since all the examples I have seen are very simple.
    Anyone have a suggestion on how to use Count() with date parameters?
    Thanks.

    Any chance you can get the date formats in the correct format from siebel?
    I don't know Siebel - so I can't help you with that. If you get the correct format it is just
    <?count(row[(FromDate>=date) and  (date<=ToDate))?>
    Otherwise the approach would probably need to use string function to get year/monthd/day from the date
    and store it into a varialbe and compare later the same way
    <?variable@incontext:from; ....?>
    <?variable@incontext:to; ...?>
    <?count(row[($from>=date) and  (date<=$to))?>
    Potentially you can use the date functions such as xdofx:to_date to do the conversion
    [http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481158.htm]
    But I am not sure if they are available in your siebel implementation.
    Hope that helps

  • How to use counter using PCI 6259

    Hello, users,
    I have a PCI 6259 board and use Labview 7.1.
    I'd like to repetitively count the photon signals at 10ms integration time. I want cumulative counts in every 1 sec (1000ms) (or 1 min (60000ms)) And I want to save counts into txt.file which is open in excel program.
    I am a beginner to use counter using PCI 6259 board.
    1. Could you explain default NI-DAQmx counter terminals, i.e., CTR 0 SRC, CTR 0 GATE, CTR 0 AUX, and CTR 0 OUT?
    2. How do I use them or how can I connect to count TTL pulse using PCI 6259?
    3. As I mention my purpose above, which example is the first step to start working my purpose?
    4. If you know good example, could you tell me about that?
    5. If anyone has labview example which is similar to my aim, could you give me some tips or your examples?
    Any hint, comment or advice would be appreciated.
    Thank you so much for your response.
    Leek2

    I have never used the PCI 6259 but have used counters many times with labview, the coding should be the same independent of the board.  What you want to do is finite buffered edge counting using a internal clock.  The best way to do this is to look at the examples programs and use the express vi to get started, then you can use this code to customize your program exactly as you need.
    To address your questions:
    1. CTR0 means "counter 0" the name of the physical resource sometimes listed at GPCTR0.  Each counter has 4 connections to the outside world:
    source "src"(for counting input TTL signals),
    gate (for synchronizing to external clocks and edges),
    out (for pulse-train out operations)
    and aux (specialty operations such as up/down counting and encoding)
    2.For event counting with internal clocking you will only use the src this is the input from the signal you wish to count (ie PMT discriminator for photon counting).
    3,4,5. Look at the count edge examples, there isn't one that does exactly what you want but I have done this with a 6602 (it has e counters) where I use one set of counters to set up a finite pulse train in your case 1000Hz with 1000 pulses, and another counter to edge count on an external pulse, with the source of this pulse routed from the out of the other counter.  Then you can start the task and read when 1000 samples are in the buffer (about 1 second later).
    Hope this helps,
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Use timing measured using counter 1 to set the pulse width on counter 2

    I am measuring time between 2 edges on counter 1.  I want to be able to generate a pulse on counter 2 that is dependent on the time measured by counter 1.  The delay on counter 2 is a multiplicative of the time measured on counter 1. Is this even possible?

    Hi Thaison V,
    I am using a PCI 6251 M series card and using DAQMX.  Your assumptions are alomost correct.  I am using a period measurement to measure time in between two leading edges on counter 1 inside a while loop.  I had set up the second counter to generate a single pulse on each trigger (retriggerable digital trigger) inside the same loop and update the low time of the pulse using the channel property.  There seems to be a 2 iteration delay between when counter 2 catches up with time measured on counter 1 time.  I believe this is because the pulse is already generated before the vaule is measured on counter 1.  I suppose if I can use counter write after the counter 1 is read out it might work, but I haven't figured out how to use DAQMX write to write a single pulse ( it works only for pulse train??).
    thanks for your help
    V

  • Object use count is negative when two users access ViewObject at same time

    I need help!
    In my application, if two users execute the same view object at the same time, the users will see a combination of the two record sets: One user will receive their requested result set plus part of the other user's set and the other will receieve only a partial result set.
    Here is what I get in the BC4J log:
    [1397] Diagnostic Properties: Timing:false Functions:false Linecount:true Threshold:6
    [1398] Connected to Oracle JBO Server - Version: 9.0.5.16.0
    [1399] mPCollUsePMgr is false
    [1400] ViewObjectImpl.mDefaultMaxRowsPerNode is 70
    [1401] ViewObjectImpl.mDefaultMaxActiveNodes is 30
    [1402] Default locking mode changed to: optimistic
    [1403] Created root application module: 'net.tetra.w2ms.Manager.model.w2ms_mgr_AppModule'
    [1404] Locale is: 'en_US'
    [1405] Oracle SQLBuilder: Registered driver: oracle.jdbc.driver.OracleDriver
    [1406] Creating a new pool resource
    [1407] Trying connection/2: url='jdbc:oracle:thin:@tetusdb01.tetra.net:1521:TETDW' info='{user=tetw2ms, password=wireless2}' ...
    [1408] Successfully logged in
    [1409] JDBCDriverVersion: 9.0.1.5.0
    [1410] DatabaseProductName: Oracle
    [1411] DatabaseProductVersion: Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.3.0 - Production
    [1412] Column count: 39
    [1413] ViewObject: ImBininventoryView close prepared statements...
    [1414] ViewObject: ImBininventoryView Created new QUERY statement
    [1415] SELECT ImBininventory.ITEMNUMBER, ImBininventory.STATUS, ImBininventory.LOCATION, ImBininventory.PALLETNUMBER, ImBininventory.LOTNUMBER, ImBininventory.STATUS1, ImBininventory.ITEM1, ImBininventory.LOCATION1, ImBininventory.PALLET1, ImBininventory.LOT1, ImBininventory.LOCATION2, ImBininventory.ITEM2, ImBininventory.STATUS2, ImBininventory.PALLET2, ImBininventory.LOT2, ImBininventory.PALLET3, ImBininventory.LOT4, ImBininventory.LOCATION5, ImBininventory.STATUS5, ImBininventory.PALLET5, ImBininventory.LOT5, ImBininventory.ITEM5, ImBininventory.ITEM6, ImBininventory.STATUS6, ImBininventory.EXPIRATIONDATE6, ImBininventory.RECEIVEDATE6, ImBininventory.LOCATION6, ImBininventory.PALLET6, ImBininventory.LOT6, ImBininventory.QTYONHANDNEG7, ImBininventory.QTYONHAND, ImBininventory.QTYALLOCATED, ImBininventory.QTYBACKORDERED, ImBininventory.QTYONORDER, ImBininventory.PONUMBER, ImBininventory.FREEZEQTYONHAND, ImBininventory.STOPSHIPDATE, ImBininventory.DATELASTCOUNTED, ImBininventory.FILLER FROM IM_BININVENTORY ImBininventory WHERE (location2 = '#RCV' and qtyonhand > 0)
    [1416] Bind params for ViewObject: ImBininventoryView
    [1417] Column count: 8
    [1418] ViewObject: VReplenishmentView close prepared statements...
    [1419] ViewObject: VReplenishmentView Created new QUERY statement
    [1420] SELECT VReplenishment.ITEMNUMBER, VReplenishment.BIN, VReplenishment.QTYONHAND, VReplenishment.DEMAND, VReplenishment.QTY_TO_PICK, VReplenishment.ENABLED, VReplenishment.UNITSPERPALLET, VReplenishment.PALLETCAPACITY FROM V_REPLENISHMENT VReplenishment WHERE (1=1)
    [1421] Bind params for ViewObject: VReplenishmentView
    [1422] Column count: 8
    [1423] ViewObject: VReplenishmentView Reusing defined prepared Statement
    [1424] Bind params for ViewObject: VReplenishmentView
    [1425] $$added root$$ id=-2
    [1426] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getItemnumber(VReplenishmentViewRowImpl.java:41)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1427] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getBin(VReplenishmentViewRowImpl.java:57)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1428] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getQtyonhand(VReplenishmentViewRowImpl.java:73)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1429] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getBin(VReplenishmentViewRowImpl.java:57)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.validate(ViewRowImpl.java:615)
         at oracle.jbo.server.ViewRowSetIteratorImpl.validateCurrentRow(ViewRowSetIteratorImpl.java:3090)
         at oracle.jbo.server.ViewRowSetIteratorImpl.next(ViewRowSetIteratorImpl.java:1545)
         at oracle.jbo.server.ViewRowSetImpl.next(ViewRowSetImpl.java:2606)
         at oracle.jbo.server.ViewObjectImpl.next(ViewObjectImpl.java:5006)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2140)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1431] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getQtyonhand(VReplenishmentViewRowImpl.java:73)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1432] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getItemnumber(VReplenishmentViewRowImpl.java:41)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1432] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.validate(ViewRowImpl.java:615)
         at oracle.jbo.server.ViewRowSetIteratorImpl.validateCurrentRow(ViewRowSetIteratorImpl.java:3090)
         at oracle.jbo.server.ViewRowSetIteratorImpl.next(ViewRowSetIteratorImpl.java:1545)
         at oracle.jbo.server.ViewRowSetImpl.next(ViewRowSetImpl.java:2606)
         at oracle.jbo.server.ViewObjectImpl.next(ViewObjectImpl.java:5006)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2140)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1434] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getBin(VReplenishmentViewRowImpl.java:57)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1435] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getQtyonhand(VReplenishmentViewRowImpl.java:73)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1436] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getItemnumber(VReplenishmentViewRowImpl.java:41)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1437] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getBin(VReplenishmentViewRowImpl.java:57)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1438] oracle.jbo.common.JboAssert: (Assertion Failed) Object use count is negative on VR of VO VReplenishmentView
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:303)
         at oracle.jbo.common.Diagnostic.ASSERT(Diagnostic.java:326)
         at oracle.jbo.server.ViewRowStorage.releaseUse(ViewRowStorage.java:134)
         at oracle.jbo.server.ViewRowImpl.releaseInner(ViewRowImpl.java:238)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:647)
         at net.tetra.w2ms.Manager.model.VReplenishmentViewRowImpl.getQtyonhand(VReplenishmentViewRowImpl.java:73)
         at net.tetra.w2ms.Wavelink.BCBroker.getReplenishments(BCBroker.java:2169)
         at net.tetra.w2ms.Wavelink.events.tasks_OnLoad.process(tasks_OnLoad.java:39)
         at com.wavelink.edge.events.PostData.ZzW(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.vw(Unknown Source)
         at com.wavelink.edge.events.ApplicationContext.handleEvent(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.yZW(Unknown Source)
         at com.wavelink.studio.server.SessionServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    [1439] Column count: 8
    [1440] ViewObject: VReplenishmentView Reusing defined prepared Statement
    [1441] Bind params for ViewObject: VReplenishmentView
    [1442] $$added root$$ id=-2
    Does anyone have any ideas? This is a very frustrating problem!

    A little more detail...
    Deployment is to iAS 10g (9.0.4)
    App written with jdev 9.0.5.2
    Code where problem occurs:
    public String[] getReplenishments() throws Exception {
    String[] replenishmentLists = new String[2];
    boolean firstTime = true;
    try {
    if (w2msAM == null) {
    w2msAM = Configuration.createRootApplicationModule(amDef, config);
    ViewObject vo = w2msAM.findViewObject("VReplenishmentView");
    vo.setWhereClause("1=1");
    vo.executeQuery();
    logger.debug("VReplenishmentView returned " + vo.getRowCount() +
    " rows");
    StringBuffer rlDisplay = new StringBuffer();
    StringBuffer rlFile = new StringBuffer();
    while (vo.hasNext()) {
    if (!firstTime) {
    rlFile.append("\n");
    rlDisplay.append(",");
    firstTime = false;
    VReplenishmentViewRowImpl row = (VReplenishmentViewRowImpl) vo.next();
    rlFile.append(row.getItemnumber());
    rlDisplay.append(" " +
    (StringHelper.padRight(row.getItemnumber(), 14) +
    StringHelper.padRight(row.getBin(), 11) +
    StringHelper.padLeft(String.valueOf(
    row.getQtyonhand().longValue()).toString(), 4)));
    if (rlFile != null) {
    replenishmentLists[0] = rlFile.toString();
    rlFile = null;
    replenishmentLists[1] = rlDisplay.toString();
    rlDisplay = null;
    } else {
    replenishmentLists[0] = "";
    replenishmentLists[1] = "";
    vo.closeRowSet();
    vo.setWhereClause("1=1");
    return replenishmentLists;
    } catch (Exception e) {
    logger.error("getReplenishments:" + e.toString());
    e.printStackTrace();
    throw e;
    Thanks for any help...
    Dirk.

  • Can I use Count, Max function in PLSQL BLOCK.

    Can U help me to use count, max function in PLSQL BLOCK.
    Because it is giving me error "It is a SQL function"

    SELECT COUNT(*)
    INTO l_variable
    FROM dual;
    Will work inside PL/SQL

  • Help in using listagg function for more than 8000 char.

    Hi Friends,
    Need you urgent help in using listagg function for more than 8000 char.
    I did the below sample SQL and in "e_orig" and "d_orig" for upto 4000 char it is working fine but I have to use it for more than 8000 char. and it is giving error,
    I checked the listagg function is having limitation of 4000 char.
    I tried but I am unable to achive this. Can someone provide me a sample example to achive this
    select d.dname,d.loc,e.hiredate
    ,listagg(e.ename,',' ) within group (order by e.deptno) over (partition by e.deptno) as e_orig
    ,listagg(e.ename, ',') within group (order by e.sal) over (partition by e.deptno) as d_orig
    from emp e, dept d
    where e.deptno=d.deptno;[ This is my first post, I gone through the guideline for posting a post , and try to go according to that ( I have not pasted here create table and insert as I have used basic table emp, dept for example), please let me know if still I should give this, I will take care from my next post ]
    Thanks in advance

    Interesting, I didn't know you could do that, but...
    BluShadow wrote:
    You could write some PL/SQL code that does it all for you, but that would involve loops and would be slow.Well, objects are written in PL/SQL aren't they? And presumably there'll be implicit looping too? So it's not at all obvious that this method will be faster than doing the joining in PL/SQL in memory. The only way to find out is to benchmark them - so I have done that.
    I noticed that OP's ref cursor actually only ever retrieves a single record for a bound department number, so I decided the best thing would be to test using a procedure that passes an output string back. I selected all (109) employees and put spaces in to ensure above 4000 characters. I also noticed that as he is using PL/SQL he probably can use a VARCHAR2 type, but just not ListAgg in the query, so I wrote short procedures as follows:
    SimpleAggChr     - bulk collect and array processing, VARCHAR2 output
    ClobAggPrc     - the custom aggregation method, CLOB output
    SimpleAggClob     - bulk collect and array processing, CLOB output
    I then wrote a driving script that calls them in the order above and times each call (I like benchmarking so I have my own timing object to make it easy). I then print the lengths for checking, and my object writes the timings to my output table. Running a few times I got varying results, but generally it looks like there isn't a lot to choose between them for performance.
    Here's the procedure code:
    CREATE OR REPLACE TYPE char100_list_type AS TABLE OF VARCHAR2(100)
    CREATE OR REPLACE PROCEDURE SimpleAggChr (x_out OUT VARCHAR2) IS
      l_enames     char100_list_type;
    BEGIN
      SELECT first_name || '                                        ' || last_name
        BULK COLLECT INTO l_enames
        FROM employees
       ORDER BY salary;
      FOR i IN 1..l_enames.COUNT LOOP
        x_out := x_out || l_enames(i) || ',';
      END LOOP;
    END SimpleAggChr;
    CREATE OR REPLACE PROCEDURE SimpleAggClob (x_out OUT CLOB) IS
      l_enames     char100_list_type;
    BEGIN
      SELECT first_name || '                                        ' || last_name
        BULK COLLECT INTO l_enames
        FROM employees
       ORDER BY salary;
      FOR i IN 1..l_enames.COUNT LOOP
        x_out := x_out || l_enames(i) || ',';
      END LOOP;
    END SimpleAggClob;
    SHO ERR
    PROMPT ClobAggPrc
    CREATE OR REPLACE PROCEDURE ClobAggPrc (x_out OUT CLOB) IS
    BEGIN
      SELECT clobagg(first_name || '                                        ' || last_name || ',')
        INTO x_out
        FROM employees
       ORDER BY salary;
    END ClobAggPrc;
    SHO ERRand the driving script:
    SET SERVEROUTPUT ON
    SET TIMING ON
    DECLARE
      l_enames_c1     CLOB;
      l_enames_c2     CLOB;
      l_enames_v     VARCHAR2(32767);
      l_timer     timer_set_type := timer_set_type ('Aggregation');
    BEGIN
      Utils.g_id := 'Aggregation';
      SimpleAggChr (l_enames_v);
      l_timer.Increment_Time ('SimpleAggChr');
      ClobAggPrc (l_enames_c1);
      l_timer.Increment_Time ('ClobAggPrc');
      SimpleAggClob (l_enames_c2);
      l_timer.Increment_Time ('SimpleAggClob');
      DBMS_Output.Put_Line ('SimpleAggChr returned string of length ' || Length (l_enames_v));
      DBMS_Output.Put_Line ('ClobAggPrc returned string of length ' || Length (l_enames_c1));
      DBMS_Output.Put_Line ('SimpleAggClob returned string of length ' || Length (l_enames_c2));
      l_timer.Write_Times;
    END;
    SET TIMING OFF
    SET LINES 150
    SET PAGES 1000
    COLUMN id FORMAT A30
    COLUMN line_text FORMAT A120
    SELECT line_text
      FROM output_log
    WHERE id = 'Aggregation'
    ORDER BY line_ind
    /and the results:
    SimpleAggChr returned string of length 5779
    ClobAggPrc returned string of length 5779
    SimpleAggClob returned string of length 5779
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:27.05
    LINE_TEXT
    Timer Set: Aggregation, constructed at 03 Nov 2011 16:27:07, written at 16:27:35
    ================================================================================
    [Timer timed: Elapsed (per call): 0.02 (0.000016), CPU (per call): 0.01 (0.000010), calls: 1000, '***' denotes corrected
    line below]
    Timer              Elapsed          CPU          Calls        Ela/Call        CPU/Call
    SimpleAggChr          9.84         0.36              1         9.84400         0.36000
    ClobAggPrc            9.37         0.32              1         9.37400         0.32000
    SimpleAggClob         8.25         0.22              1         8.25000         0.22000
    (Other)               0.00         0.00              1         0.00000         0.00000
    Total                27.47         0.90              4         6.86700         0.22500
    13 rows selected.

  • Unable to measure pulse time, using Counter pulse time 1samp.vi

    Hi
    I am using pci6624 board to measure pulse time . I have selected counter 0 to measure  pulse time & connect the signal to gate0+ & gate0-.
    When i used Counter pulse time 1samp.vi to read the pulse time , i am not able to read the value and i am getting following error msg . If i used Counter DBL 1samp.vi  i am getting out put.
    Please help me
    Attachments:
    pulse_time_measurment.vi ‏11 KB
    Counter_errors.JPG ‏44 KB

    Hi,
    You can try changing the mode to counter -> single sample -> DBL in Daqmx read function
    You can also try this example 'Meas Pulse Width-Buffered-Cont.vi' or related examples from NI Example Finder.
    Cheers,
    Sahil Gupta
    NI India

  • Need help regarding Cycle counting

    Hi All,
    I need your help regarding cycle counting process in SAP PI. The scenario is as follows,
    At present in the legacy system business practice is to count certain number of materials say 100 materials every day. Out of these 100 materials; we keep fixed percentage for the materials to be counted i.e. out of 100 certain percentage will of A material, certain percentage will of B materials like wise.
    Also every day we want to generate a list of these 100 materials to be counted (this list can be handed over to inventory person to physically count the material) and  generation of PI documents to subsequently post the count results.
    Please note that we will be manually assigning cycle count indicator (A or B or C etc) in the material master.
    Thanks,
    Attarde

    from OSS Note 518418 - FAQ: Cycle Counting
    3. Question:
    I do not understand the determination of the date of physical inventory in the cycle counting physical inventory. How is the planned date or the date of physical inventory determined in the SAP system?
    Answer:
    In principle, the program calculates the planned date of physical inventory according to the following formula:
       planned date = base date + Interval (Trans.OMCO/Tab.XT159C-ININV)
    Usually, the base date is the 'date of the last physical inventory'. Depending on the type of the stock or the batch management requirement, this date is read from one of the following table fields:
      MARD-DLINL (Normal materials)
       MCHB-CHDLL (Batch materials, separately valuated materials)
    If no physical inventory has been carried out yet and if this date field is therefore empty, the system uses the creation date of the material as basis date. The basis date then comes from one of the following table fields:
      MSTA-ERSDA (Normal materials)
       MCHB-ERSDA (Batch materials, separately valuated materials)
    Since the cycle counting physical inventory always runs for the current fiscal year, the earliest possible physical inventory date is the 01.01. and the latest possible physical inventory date is the 31.12 of the current year.
    If the date of the physical inventory is a non-working day, the program automatically proposes the next possible workday.

  • Pci 6132 digital signal using counter

    Hello,
    I want to give digital short pulse (around 10 us) in frequency of 10 Hz.
    i tried to creat digital waveform and to use the wait(ms) sub vi in labview but it's very inaccurate..
    sombody told me to use counter but i don't know exactly how.. i saw some expamle of accuaring sigital signal using counter but o coudnt understand it completly.
    any help by ver appricieate.
    thanks,
    Etay

    Hello, etay23!
    Were you able to check out the example? Do you have any questions for us about it?
    Will Hilzinger | Switch Product Support Engineer | National Instruments

  • How do I use count for this query?

    How do I display all the addresses in a table that have more than one (or >1) account number? I wasn't sure how or if I should use count along with group by and having to get the expected results.

    select address from tablename
    group by address having count(1) > 1;

  • Need help in using FM BAPI_MATERIAL_SAVEDATA

    Gurus,
    I need help in using the FM BAPI_MATERIAL_SAVEDATA. The FM is returning a message that says "The field MARA-MEINS/BAPI_MARA-BASE_UOM(_ISO) is defined as a required field; it does not contain an entry".
    I have supplied the necessary details and yet the FM won't push through.
    If possible, please post sample codes.
    Below is my sample code:
    ===============================================
    REPORT  zmm_materialupload.
    eject
    $$******************************************************************************
    $$    TYPES
    $$******************************************************************************
    eject
    $$******************************************************************************
    $$    INTERNAL TABLES (custom structure
    $$******************************************************************************
    eject
    $$******************************************************************************
    $$    RANGES
    $$******************************************************************************
    eject
    $$******************************************************************************
    $$    FIELD-SYMBOLS
    $$******************************************************************************
    eject
    $$******************************************************************************
    $$    PARAMETERS & SELECT-OPTIONS
    $$******************************************************************************
    SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
    *SELECT-OPTIONS: s_matnr FOR mara-matnr.
    SELECT-OPTIONS: s_mtart FOR mara-mtart.
    SELECT-OPTIONS: s_mbrsh FOR mara-mbrsh DEFAULT 'P'.
    SELECT-OPTIONS: s_werks FOR marc-werks DEFAULT '1000' OBLIGATORY.
    SELECT-OPTIONS: s_lgort FOR marc-lgpro DEFAULT 'OPSL' OBLIGATORY.
    PARAMETERS: p_path  LIKE rlgrap-filename DEFAULT 'C:\Documents and Settings\training_11\Desktop\Book4 (2ITEMS).txt' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FNAME'
        IMPORTING
          file_name  = p_path.
    eject
    $$******************************************************************************
    $$    START-OF-SELECTION
    $$******************************************************************************
    START-OF-SELECTION.
      PERFORM check_input.
      PERFORM get_file.
      PERFORM filter_input.
    PERFORM populate_tabs.
      PERFORM bapi_mat.
    eject
    $$******************************************************************************
    $$    FORMS
    $$******************************************************************************
    FORM bapi_mat.
      LOOP AT it_tab INTO wa_tab.
        CALL FUNCTION 'BAPI_MATERIAL_GETINTNUMBER'
          EXPORTING
            material_type    = wa_tab-mtart
            industry_sector  = wa_tab-mbrsh
            required_numbers = 1
          TABLES
            material_number  = it_matnr.
      ENDLOOP.
      LOOP AT it_matnr INTO wa_matnr.
        READ TABLE it_tab INTO wa_tab INDEX sy-tabix.
        wa_tab-matnr = wa_matnr-material.
        MODIFY it_tab FROM wa_tab INDEX sy-tabix.
      ENDLOOP.
      PERFORM populate_tabs.
      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
         headdata                   = it_headdata
        clientdata                 = it_clientdata
        clientdatax                = it_clientdatax
        plantdata                  = it_plantdata
        plantdatax                 = it_plantdatax
        FORECASTPARAMETERS         =
        FORECASTPARAMETERSX        =
        PLANNINGDATA               =
        PLANNINGDATAX              =
        STORAGELOCATIONDATA        =
        STORAGELOCATIONDATAX       =
        valuationdata              = it_valuationdata
        valuationdatax             = it_valuationdatax
         WAREHOUSENUMBERDATA        =
        WAREHOUSENUMBERDATAX       =
        SALESDATA                  =
        SALESDATAX                 =
        STORAGETYPEDATA            =
        STORAGETYPEDATAX           =
        flag_online                = ' '
        flag_cad_call              = ' '
        NO_DEQUEUE                 = ' '
        NO_ROLLBACK_WORK           = ' '
       IMPORTING
         return                     = it_return
       TABLES
         materialdescription        = it_materialdescription
         unitsofmeasure             = it_unitsofmeasure
         unitsofmeasurex            = it_unitsofmeasurex
         internationalartnos        = it_internationalartnos
         materiallongtext           = it_materiallongtext
         taxclassifications         = it_taxclassifications
         returnmessages             = it_returnmessages
        PRTDATA                    =
        PRTDATAX                   =
        EXTENSIONIN                =
        EXTENSIONINX               =
      IF sy-subrc = 0.
      ENDIF.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait   = 'X'
        IMPORTING
          return = it_return.
    ENDFORM.                    "bapi_mat
    *&      Form  GET_FILE
          text
    FORM get_file.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text = 'Getting data from file...'.
      MOVE: p_path TO gv_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gv_file
          filetype                = 'ASC'
          has_field_separator     = 'X'
          read_by_line            = 'X'
        TABLES
          data_tab                = it_tab
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    "GET_FILE
    *&      Form  check_input
          text
    FORM check_input.
    Material Type
      IF s_mtart-low IS INITIAL AND s_mtart-high IS INITIAL.
       s_mtart = 'IEQ'.
       s_mtart-low = 'ABF'.        "Waste
       s_mtart-high = 'ZTRD'.      "Stock Items
       APPEND s_mtart.
      ENDIF.
      IF s_mtart-low IS NOT INITIAL AND s_mtart-high IS INITIAL.
        MOVE: s_mtart-low TO s_mtart-high.
      ENDIF.
    Industry Sector
      IF s_mbrsh-low IS INITIAL AND s_mbrsh-high IS INITIAL.
       s_mbrsh = 'IEQ'.
       SELECT mbrsh
       FROM mara
       INTO TABLE it_mbrsh.
       s_mbrsh-low = wa_mbrsh-mbrsh.
       LOOP AT it_mbrsh INTO wa_mbrsh.
         s_mbrsh-high = wa_mbrsh-mbrsh.
       ENDLOOP.
       APPEND s_mbrsh.
      ENDIF.
      IF s_mbrsh-low IS NOT INITIAL AND s_mbrsh-high IS INITIAL.
        MOVE: s_mbrsh-low TO s_mbrsh-high.
      ENDIF.
    Plant
      IF s_werks-low IS INITIAL AND s_werks-high IS INITIAL.
        s_werks = 'IEQ'.
        s_werks-low = '1000'.
        s_werks-high = '2000'.
      ENDIF.
      IF s_werks-low IS NOT INITIAL AND s_werks-high IS INITIAL.
        MOVE: s_werks-low TO s_werks-high.
      ENDIF.
    Storage Location
      IF s_lgort-low IS NOT INITIAL AND s_lgort-high IS INITIAL.
        MOVE: s_lgort-low TO s_lgort-high.
      ENDIF.
    ENDFORM.                    "check_input
    *&      Form  Filter_input
          text
    FORM filter_input.
      SORT it_tab BY matnr mtart mbrsh werks lgort.
      LOOP AT it_tab INTO wa_tab.
       IF wa_tab-mtart NOT IN s_mtart.
         DELETE it_tab WHERE mtart NOT IN s_mtart.
       ENDIF.
       IF wa_tab-mbrsh NOT IN s_mbrsh.
         DELETE it_tab WHERE mbrsh NOT IN s_mbrsh.
       ENDIF.
        IF wa_tab-werks NOT IN s_werks.
          DELETE it_tab WHERE werks NOT IN s_werks.
        ENDIF.
        IF wa_tab-lgort NOT IN s_lgort.
          DELETE it_tab WHERE lgort NOT IN s_lgort.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "Filter_input
    *&      Form  populate_tabs
          text
    FORM    populate_tabs.
      LOOP AT it_tab INTO wa_tab.
        MOVE: wa_tab-matnr TO wa_headdata-material,
              wa_tab-mbrsh TO wa_headdata-ind_sector,
              wa_tab-mtart TO wa_headdata-matl_type,
                       'X' TO wa_headdata-basic_view,
                       'X' TO wa_headdata-sales_view,
                       'X' TO wa_headdata-purchase_view,
                       'X' TO wa_headdata-mrp_view,
                       'X' TO wa_headdata-account_view.
             wa_tab-matkl TO wa_clientdata-matl_group,
             wa_tab-meins TO wa_clientdata-base_uom,
             wa_tab-groes TO wa_clientdata-size_dim,
             wa_tab-gewei TO wa_clientdata-unit_of_wt,
             wa_tab-ntgew TO wa_clientdata-net_weight,
                      'X' TO wa_clientdatax-matl_group,
                      'X' TO wa_clientdatax-base_uom,
                      'X' TO wa_clientdata-size_dim,
                      'X' TO wa_clientdatax-unit_of_wt,
                      'X' TO wa_clientdatax-net_weight,
             wa_tab-werks TO wa_plantdata-plant,
             wa_tab-ekgrp TO wa_plantdata-pur_group,
             wa_tab-prctr TO wa_plantdata-profit_ctr,
             wa_tab-werks TO wa_plantdatax-plant,
                      'X' TO wa_plantdatax-pur_group,
                      'X' TO wa_plantdatax-profit_ctr,
             wa_tab-werks TO wa_valuationdata-val_area,
             wa_tab-bklas TO wa_valuationdata-val_class,
             wa_tab-peinh TO wa_valuationdata-price_unit,
             wa_tab-verpr TO wa_valuationdata-moving_pr,
             wa_tab-stprs TO wa_valuationdata-std_price,
             wa_tab-xlifo TO wa_valuationdata-lifo_fifo,
             wa_tab-werks TO wa_valuationdatax-val_area,
                      'X' TO wa_valuationdatax-val_class,
                      'X' TO wa_valuationdatax-price_unit,
                      'X' TO wa_valuationdatax-moving_pr,
                      'X' TO wa_valuationdatax-std_price,
                      'X' TO wa_valuationdatax-lifo_fifo.
        APPEND wa_headdata TO it_headdata.
       APPEND wa_clientdata TO it_clientdata.
       APPEND wa_plantdata TO it_plantdata.
       APPEND wa_valuationdata TO it_valuationdata.
       MODIFY it_tab FROM wa_tab TRANSPORTING matnr.
      ENDLOOP.
    ENDFORM.                    "populate_tabs
    $$******************************************************************************

    Hai.
    check the below example.
    REPORT z34332_bdc_create_material .
    data: la_headdata type BAPIMATHEAD,
    la_clientdata type BAPI_MARA,
    la_CLIENTDATAX type BAPI_MARAX,
    la_return type BAPIRET2.
    data: i_materialdescription type table of BAPI_MAKT,
    wa_materialdescription like line of i_materialdescription.
    la_headdata-MATERIAL = '000000000000000004'.
    la_headdata-IND_SECTOR = 'M'.
    la_headdata-MATL_TYPE = 'FERT'.
    la_clientdata-BASE_UOM = 'FT3'.
    la_CLIENTDATAX-BASE_UOM = 'X'.
    la_clientdata-MATL_GROUP = '01'.
    la_CLIENTDATAX-MATL_GROUP = 'X'.
    wa_materialdescription = 'TEST'.
    append wa_materialdescription to i_materialdescription.
    clear: wa_materialdescription.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
    headdata = la_headdata
    CLIENTDATA = la_clientdata
    CLIENTDATAX = la_CLIENTDATAX
    PLANTDATA =
    PLANTDATAX =
    FORECASTPARAMETERS =
    FORECASTPARAMETERSX =
    PLANNINGDATA =
    PLANNINGDATAX =
    STORAGELOCATIONDATA =
    STORAGELOCATIONDATAX =
    VALUATIONDATA =
    VALUATIONDATAX =
    WAREHOUSENUMBERDATA =
    WAREHOUSENUMBERDATAX =
    SALESDATA =
    SALESDATAX =
    STORAGETYPEDATA =
    STORAGETYPEDATAX =
    FLAG_ONLINE = ' '
    FLAG_CAD_CALL = ' '
    IMPORTING
    RETURN = la_return
    TABLES
    MATERIALDESCRIPTION = i_materialdescription
    UNITSOFMEASURE =
    UNITSOFMEASUREX =
    INTERNATIONALARTNOS =
    MATERIALLONGTEXT =
    TAXCLASSIFICATIONS =
    RETURNMESSAGES =
    PRTDATA =
    PRTDATAX =
    EXTENSIONIN =
    EXTENSIONINX =
    write: la_return-TYPE, ',', la_return-MESSAGE.
    clear: la_headdata, la_return, la_clientdata, la_clientdatax.
    regards.
    sowjanya.b.

Maybe you are looking for