Record count for a timeframe

My table employee has a column hiredate of type DATE.
we can see count of records (means how many employees are hired) from that table for a given begin and end hiredate.
Here's the tricky part:
for the timeframe say 03-MAR-2010 to 23-MAR-2010, I want to show results how many people are hired in each week:
resultset should be:
(cutoff date for weeks is Monday midnight: like this)
week no. of employees hired
03-MAR-2010 to 08-MAR-2010(exclusive) 5
08-MAR-2010 to 15-MAR-2010(exclusive) 16
15-MAR-2010 to 22-MAR-2010(exclusive) 67
22-MAR-2010 to 24-MAR-2010(means including employees hired on 23rd) 29
How to do it?

Your solution is great except that is shows the result based on emplyees table not calendar of working days for a concrete period.
For example if nobody was hired for a week then the row for this week will be absent. This info could be useful for diagrams creation.
To address the issue we could join employees on calendar:
select working_days_calendar.start_date,
       working_days_calendar.end_date,
       count(employees.id)
  from ( select distinct
                    min(date_hired) keep (dense_rank first order by date_hired) over (partition by next_day(date_hired, 1)) start_date,
                    max(date_hired) keep (dense_rank last order by date_hired) over (partition by next_day(date_hired, 1)) end_date
             from ( select trunc(to_date('06-APR-10', 'DD-MON-YY')) + level date_hired,
                                to_number(to_char(trunc(to_date('06-APR-10', 'DD-MON-YY')) + level, 'D')) day_of_week
                        from dual
                connect by trunc(to_date('06-APR-10', 'DD-MON-YY')) + level <= trunc(to_date('26-APR-10', 'DD-MON-YY')) )
          where day_of_week between 2 and 6
          order by start_date ) working_days_calendar left join employees on ( employees.hire_date between working_days_calendar.start_date and working_days_calendar.end_date )
group by working_days_calendar.start_date, working_days_calendar.end_dateEdited by: Stepanyan Alexey on 04.04.2010 6:39

Similar Messages

  • How to caculate the records count for a measurement with a filter?

    I have a fact table which add relationship to a datetime dimension. I create a measurement based on the fact table, like [MeasureA]. I want to calculate the record counts of [measureA] of today, how to write the mdx query? Thanks!

    Hi Lavandula,
    According to your description, you want to calculate the numbers of the record of a measure for a specific day, right? In this case, you can use
    Count function which returns the number of cells in a set to achieve you requirement. Here is a sample query on Adventure Works for your reference.
    WITH
    MEMBER [Measures].[SetCount] AS
    COUNT([Product].[Product].[Product].Members)
    SELECT
    {[Measures].[SetCount]} ON COLUMNS
    FROM
    [Adventure Works]
    Besides, if you want to count the cell numbers with a condition, you can use
    Filter funtion inside the Count function.
    WITH MEMBER [Measures].[High Volume Products Count] AS
    Count(Filter([Product].[Product].[Product], [Measures].[Internet Order Quantity] > 5))
    SELECT [Customer].[Customer Geography].[Country] ON 0
    , [Date].[Calendar].[Date].MEMBERS ON 1
    FROM [Adventure Works]
    WHERE [Measures].[High Volume Products Count]
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to get the total record count for the report

    Hi,
    How can I get count of the total records shown in the report. When we set the report attributes, we have an option "Set Pagination from X to Y of Z"
    Does anyone know how can I get the Z value from APEX variables.
    I know we can use that query and get the count but I just want to know how we can use APEX Variables effectively.
    Thanks in advance.

    You write a loop, something like this:
    Go_block('B1');
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    First_Record;
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    Loop
      If :system.record_status in('CHANGED','INSERT') then
        -- modify the record here--
      End if;
      Exit when :System.Last_Record = 'TRUE';
      Next_Record;
    End Loop;
    First_Record;But be very careful-- If your block can fetch a large number of rows, (over 100), this loop can take a long time, and you should not use this method. The loop will continue fetching more rows from the database until all rows satisfying the query are retrieved.

  • Record count in internal table

    i want to know record count for the records stored in
    internal table.
    do we have any system field to display record count?

    Hi,
    Try this:
    Data: count_lines type i.
    describe table my_table lines count_lines.
    Regards,
    Arjan

  • Problem in getting update records count while executeBatch()

    hi,
    I have used "Select in Insert" queries for migrating data from one table to another.
    like
    INSERT INTO TABLE1 (COL1, COL2)
    SELECT COL1,COL2,... FROM TABLE2
    WHERE COL1 = ... AND COL2 = ...;
    Case 1:
    I added these statements as addBatch() & at the end i execute method " executeBatch()". It returned the array of integer having record count for each query respectively.
    But that count was always be -2 i.e. SUCCESS_NO_INFO.
    Case 2:
    If i run the same code with executeUpdate() method , it returned me the correct number of records counts that are inserted into the table.
    I cudn't able to understand that it is failing for case1.
    Can anybody tell the reason for this behaviour .......................
    Edited by: user11187328 on Mar 17, 2010 3:45 AM
    Edited by: user11187328 on Mar 17, 2010 3:46 AM

    hi,
    Thanks again for a correct reply but can u also tell me tht which jar i needs to included.
    There are so many jar files & should i remove old jar files or jvm auto picks the updated jar file.
    Following jar files are shown on the link:::
    ojdbc5.jar (1,996,228 bytes) - Classes for use with JDK 1.5. It contains the JDBC driver classes, except classes for NLS support in Oracle Object and Collection types.
    ojdbc5_g.jar (3,081,328 bytes) - Same as ojdbc5.jar, except that classes were compiled with "javac -g" and contain tracing code.
    ojdbc6.jar (2,111,220 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
    ojdbc6_g.jar (3,401,519 bytes) - Same as ojdbc6.jar except compiled with "javac -g" and contains tracing code.
    ojdbc5dms.jar (2,429,777 bytes) - Same as ojdbc5.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc5dms_g.jar (3,101,875 bytes) - Same as ojdbc5_g.jar, except that it contains instrumentation to support DMS.
    ojdbc6dms.jar (2,655,741 bytes) - Same as ojdbc6.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc6dms_g.jar (3,423,263 bytes) - Same as ojdbc6_g.jar except that it contains instrumentation to support DMS.
    orai18n.jar (1,656,280 bytes) - NLS classes for use with JDK 1.5, and 1.6. It contains classes for NLS support in Oracle Object and Collection types. This jar file replaces the old nls_charset jar/zip files.
    demo.zip (603,363 bytes) - contains sample JDBC programs.

  • Getting a record count in a query using UNIQUE

    I need to know how to grab a record count for a query so I can pass it back into the recordset.
    This select query uses UNIQUE to rollup the 555 records to 125 unique rows.
    But how would I do a record count.
    Do I pass the query to a cursor and then count the records in the cursor?
    Please detail your help please.
    Thank you in advance.

    SELECT unique
         CE.DATE_OF_SERVICE AS DOS_FROM
         ,CE.SERVICE_END_DATE AS DOS_TO
         ,CE.EVENT_SERVICE AS SERVICE_TYPE
         ,CN.CREATE_DATE_TIME
         ,CN.CASE_NOTE_ID
         ,CN.CASE_ID
         ,CN.EVENT_ID
         ,CN.REASON
         ,CN.CREATOR_USER_ID AS CREATOR_ID_USED
         ,CN.ROWID AS ROW_ID
         ,(SELECT Retrieve_Note2(CN.CASE_ID,CN.CASE_NOTE_ID) from DUAL) AS NOTE
    FROM
         MEMBER_TO_PATIENT MTA,
         CARE_EVENT CE,
         CASE_NOTES CN
    WHERE
         MTA.SUBSCRIBER_LID = '1260016473015' AND
         MTA.CASE_ID = CN.CASE_ID AND
         CN.EVENT_ID = CE.EVENT_ID
    ORDER BY
         CN.CASE_NOTE_ID DESC

  • Count for item records reaches 999 the second idoc gets triggered!

    Hi Experts,
         I have an issue. Sender is file and receiver is idoc with a header and item  level records. Only one header and n number of records can be there.
    Now we want to make  this way that as soon as the count for item records reaches 999 the second idoc gets triggered.
      Hints / Solutions Pls.
    Regards,
    Arnab .

    incorporate mapping logic such that for every 999 item records create new IDoc node
    check with this UDF for IDoc node mapping, item records will be input to UDF
    int count = a.length;
    int k=999;
    result.addValue("");
    for(int i=0;i<count;i++)
          if (i>=k){
              result.addValue(""); // if records > 999, add IDoc node
              k=k+999;     
    Do rest of the mapping accordingly

  • How to get the record count printed for the report in the Dashboards

    Hi,
    I would like to get the record count printed at the bottom of every dashboard report like:
    < 1 - 25 of 6300 > instead of < 1 - 25 >
    Any help is appreciated
    Regards
    B

    I have tried the following formula which identifies the lowest grain but it does not seem to give me correct result.. I am not getting the correct count. I am getting as 3.A work order can be updated only once at one point of time.hence the formula
    MAX(RCOUNT(CAST("SR Wo Fact"."Crm Wo Number" AS CHAR) ||CAST("SR Wo Fact"."PSC Timestamp" as char)))
    I tried only MAX(RCOUNT(1)), but I was able to get the record count as corect for Administrator but not for other users.
    Has anyone come across this scenario.
    Thanks Shravan
    Edited by: 786443 on Aug 19, 2010 10:22 AM

  • Record count is different for Full load and Init with data transfer

    Hi all,
    We have a data source for which delta is enabled on Calendar Day.
    If I run the full load record count is 2670.But If I run the delta record count is 2665.5 records are missing.
    Would you please help on this.Why those records are missing.

    Hi,
    Actually for Full Load say you have 50 records. When you run it will upload 50 records.
    Now if you run delta if there is no records changes it wouldnt update because there is no update in the existing records.
    only delta is done when there is changes in the records.

  • Showing Dimension counts for record results.

    Hi experts,
    In my application, I want to show dimension counts for record results. Support results contains 50 records, Out of 50 records, with Color=Red has 15 records. Therefore I want to display the Red Color results as -
    Color:
    Red (15)
    Silver(5)
    Like wise for other dimensions as well. As per the Endeca documentations, I guess "Drs" parameter is there to achieve it. If this is true then can you guys explain how the required functionality can be achieved using endea_jspref application . Or using presentation api, what kind of code should be written.
    Any input/ideas will be highly appreciated.
    Regards,
    Hoque

    Hi,
    in my code level i used like below to display num of records
    if you use RefinementMenu cartridge(in jsp RefinementMenu.jsp) you will get refinements in that content.
    <c:forEach items="${content.refinements}" var="refinement">
    <li>
    <dsp:include page="/renderNavLink.jsp">
    <dsp:param name="navAction" value="${refinement}"/>
    <dsp:param name="text" value="${refinement.label} (${refinement.count}) "/>
    </dsp:include>
    </li>
    </c:forEach>
    in above ${refinement.label} :: means the lable name(color:red,silver) and
    (${refinement.count}) :: means the no of records it has( red(10), silver(12))
    in renderlink.jsp i used to render content or navigation based on your click(red or silver)
    i think so it may help you from endeca Stuff.
    Regards
    Y.V.L

  • How do I show a count for rows that don't exist?

    Hi, I'm trying to count the number of records grouped by rank(B,C,R),month,and year. Basically, anytime a part fails testing a record is entered which records the failure Rank and occurrence date. A record is only inserted if a part failed for specific rank. So not all 3 ranks will have entries. I'm able to count all ranks by month,year that do exist. But how do I get values of 0 for the ranks that don't exist? I just created a table qa_rank that has just one column rank with 3 records(b,c,r). but its not being used as of now. rank is just a column in qa_occ record.Here is my query.
    select to_char(occdate,'YY') as yr, to_char(occdate,'MM') as mn,
    rank, count(occdate)
    from qa_occ
    where q.occdate between '1-Apr-2005'and '31-Mar-2006'
    and q.supplier = '11107'
    group by to_char(q.occdate,'YY'),to_char(q.occdate,'MM'),q.rank
    order by to_char(q.occdate,'YY'),to_char(q.occdate,'MM')
    which returns this
    YY MM RANK COUNT(OCCDATE)
    05 09 C 2
    05 10 C 2
    05 11 C 1
    05 11 R 1
    06 01 C 3
    06 02 C 1
    06 03 B 1
    06 03 C 2
    I need it to return C,B,R for everymonth. If no records exist then the count for the month,rank should be 0. Any ideas? Thanks.

    something like:
    SQL> with qa_occ as
      2  (select to_date('09/15/2005','mm/dd/yyyy') occdate, 'B3661-RYPX-A000' part, 'C' rank, 4 indexpoints from dual
      3   union all
      4   select to_date('09/25/2005','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
      5   union all
      6   select to_date('10/11/2005','mm/dd/yyyy') occdate, null part, 'C' rank, 7 indexpoints from dual
      7   union all
      8   select to_date('10/20/2005','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
      9   union all
    10   select to_date('11/11/2005','mm/dd/yyyy') occdate, null part, 'C' rank, 4 indexpoints from dual
    11   union all
    12   select to_date('11/18/2005','mm/dd/yyyy') occdate, 'B3661-RYPX-A000' part, 'R' rank, 0 indexpoints from dual
    13   union all
    14   select to_date('01/11/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    15   union all
    16   select to_date('01/25/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    17   union all
    18   select to_date('01/27/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    19   union all
    20   select to_date('02/15/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    21   union all
    22   select to_date('03/07/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    23   union all
    24   select to_date('03/14/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    25   union all
    26   select to_date('03/15/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'B' rank, 13 indexpoints from dual)
    27  select * from qa_occ;
    OCCDATE   PART            R INDEXPOINTS
    15-SEP-05 B3661-RYPX-A000 C           4
    25-SEP-05 B3661-RYP-A000  C           4
    11-OCT-05                 C           7
    20-OCT-05 B3661-RYP-A000  C           4
    11-NOV-05                 C           4
    18-NOV-05 B3661-RYPX-A000 R           0
    11-JAN-06 B3661-RYP-A000  C           4
    25-JAN-06 3511-RNA0-0111  C           4
    27-JAN-06 3511-RNA0-0111  C           4
    15-FEB-06 3511-RNA0-0111  C           4
    07-MAR-06 B3661-RYP-A000  C           4
    14-MAR-06 B3661-RYP-A000  C           4
    15-MAR-06 3511-RNA0-0111  B          13
    13 rows selected.
    assuming that there are only three ranks available B, C,and R we considered this as a lookup values. now in the query below we incorporate an inline view for the lookup values:
    SQL> with qa_occ as
      2  (select to_date('09/15/2005','mm/dd/yyyy') occdate, 'B3661-RYPX-A000' part, 'C' rank, 4 indexpoints from dual
      3   union all
      4   select to_date('09/25/2005','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
      5   union all
      6   select to_date('10/11/2005','mm/dd/yyyy') occdate, null part, 'C' rank, 7 indexpoints from dual
      7   union all
      8   select to_date('10/20/2005','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
      9   union all
    10   select to_date('11/11/2005','mm/dd/yyyy') occdate, null part, 'C' rank, 4 indexpoints from dual
    11   union all
    12   select to_date('11/18/2005','mm/dd/yyyy') occdate, 'B3661-RYPX-A000' part, 'R' rank, 0 indexpoints from dual
    13   union all
    14   select to_date('01/11/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    15   union all
    16   select to_date('01/25/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    17   union all
    18   select to_date('01/27/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    19   union all
    20   select to_date('02/15/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    21   union all
    22   select to_date('03/07/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    23   union all
    24   select to_date('03/14/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    25   union all
    26   select to_date('03/15/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'B' rank, 13 indexpoints from dual)
    27  select qa.yr, qa.mn,
    28         decode(qa.rank,lk.rank,qa.rank,lk.rank) rank,
    29         sum(decode(qa.rank,lk.rank,qa.cnt,0)) cnt
    30    from (select to_char(qo.occdate,'YY') as yr,
    31                 to_char(qo.occdate,'MM') as mn,
    32                 qo.rank,
    33                 count(qo.occdate) cnt
    34            from qa_occ qo
    35          group by to_char(qo.occdate,'YY'),
    36                   to_char(qo.occdate,'MM'),
    37                   qo.rank) qa,
    38         (select 'B' rank from dual
    39          union all
    40          select 'C' rank from dual
    41          union all
    42          select 'R' rank from dual) lk
    43  group by qa.yr, qa.mn, decode(qa.rank,lk.rank,qa.rank,lk.rank)
    44  order by qa.yr, qa.mn, decode(qa.rank,lk.rank,qa.rank,lk.rank);
    YR MN R        CNT
    05 09 B          0
    05 09 C          2
    05 09 R          0
    05 10 B          0
    05 10 C          2
    05 10 R          0
    05 11 B          0
    05 11 C          1
    05 11 R          1
    06 01 B          0
    06 01 C          3
    06 01 R          0
    06 02 B          0
    06 02 C          1
    06 02 R          0
    06 03 B          1
    06 03 C          2
    06 03 R          0
    18 rows selected.
    SQL>

  • How to get total number of result count for particular key on cluster

    Hi-
    My application requirement is client side require only limited number of data for 'Search Key' form total records found in cluster. Also i need 'total number of result count' for that key present on the custer.
    To get subset of record i'm using IndexAwarefilter and returning only limited set each individual node. though i get total number of records present on the individual node, it is not possible to return this count to client form IndexAwarefilter (filter return only Binary set).
    Is there anyway i can get this number (total result size) on client side without returning whole chunk of data?
    Thanks in advance.
    Prashant

    user11100190 wrote:
    Hi,
    Thanks for suggesting a soultion, it works well.
    But apart from the count (cardinality), the client also expects the actual results. In this case, it seems that the filter will be executed twice (once for counting, then once again for generating actual resultset)
    Actually, we need to perform the paging. In order to achieve paging in efficient manner we need that filter returns only the PAGESIZE records and it also returns the total 'count' that meets the criteria.
    If you want to do paging, you can use the LimitFilter class.
    If you want to have paging AND total number of results, then at the moment you have to use two passes if you want to use out-of-the-box features because LimitFilter does not return the total number of results (which by the way may change between two page retrieval).
    What we currently do is, the filter puts the total count in a static variable and but returns only the first N records. The aggregator then clubs these info into a single list and returns to the client. (The List returned by aggregator contains a special entry representing the count).
    This is not really a good idea because if you have more than one user doing this operation then you will have problems storing more than one values in a single static variable and you used a cache service with a thread-pool (thread-count set to larger than one).
    We assume that the aggregator will execute immediately after the filter on the same node, this way aggregator will always read the count set by the filter.
    You can't assume this if you have multiple client threads doing the same kind of filtering operation and you have a thread-pool configured for the cache service.
    Please tell us if our approach will always work, and whether it will be efficient as compared to using Count class which requires executing filter twice.
    No it won't if you used a thread-pool. Also, it might happen that Coherence will execute the filtering and the aggregation from the same client thread multiple times on the same node if some partitions were newly moved to the node which already executed the filtering+aggregation once. I don't know anything which would even prevent this being executed on a separate thread concurrently.
    The following solution may be working, but I can't fully recommend it as it may leak memory depending on how exactly the filtering and aggregation is implemented (if it is possible that a filtering pass is done but the corresponding aggregation is not executed on the node because of some partitions moved away).
    At sending the cache.aggregate(Filter, EntryAggregator) call you should specify a unique key for each such filtering operation to both the filter and the aggregator.
    On the storage node you should have a static HashMap.
    The filter should do the following two steps while being synchronized on the HashMap.
    1. Ensure that a ConcurrentLinkedQueue object exists in a HashMap keyed by that unique key, and
    2. Enqueue the total number count you want to pass to the aggregator into that queue.
    The parallel aggregator should do the following two steps while being synchronized on the HashMap.
    1. Dequeue a single element from the queue, and return it as a partial total count.
    2. If the queue is now empty, then remove it from the HashMap.
    The parallel aggregator should return the popped number as a partial total count as part of the partial result.
    The client side of the parallel aware aggregator should sum the total counts in the partial result.
    Since the enqueueing and dequeueing may be interleaved from multiple threads, it may be possible that the partial total count returned in a result does not correspond to the data in the partial result, so you should not base anything on that assumption.
    Once again, that approach may leak memory based on how Coherence is internally implemented, so I can't recommend this approach but it may work.
    Another thought is that since returning entire cached values from an aggregation is more expensive than filtering (you have to deserialize and reserialize objects), you may still be better off by running a separate count and filter pass from the client, since for that you may not need to deserialize entries at all, so the cost on the server may be lower.
    Best regards,
    Robert

  • Table creation Error "Ref Count for this object is higher than 0"

    Hi All
    I have a problem in creation of table using SDK on a button event.  I have a procedure to create tables and fields. If I call this procedure on a menu Event than it works fine but If I call this procedure on a button event than It gives error "Ref count for this object is higher than 0" . I know this error occur When an object does not release after creating a table. but this error occur at when first table is created. My code it given below. plz see and give me your valuable suggestions.
      Dim oUserTablesMD As SAPbobsCOM.UserTablesMD
                Try
                    oUserTablesMD = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
                    oUserTablesMD.TableName = "AM_OBIN"
                    oUserTablesMD.TableDescription = "PutAway Table"
                    oUserTablesMD.TableType = BoUTBTableType.bott_Document
                    lRetCode = oUserTablesMD.Add
                    '// check for errors in the process
                    If lRetCode <> 0 Then
                        B1Connections.diCompany.GetLastError(lRetCode, sErrMsg)
                        MsgBox(sErrMsg)
                    Else
                        B1Connections.theAppl.StatusBar.SetText("Table: " & oUserTablesMD.TableName & " was added successfully", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success)
                    End If
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserTablesMD)
                    oUserTablesMD = Nothing
                    GC.Collect()
                    oUserTablesMD = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
                    oUserTablesMD.TableName = "AM_BIN1"
                    oUserTablesMD.TableDescription = "PutAway Upper Grid"
                    oUserTablesMD.TableType = BoUTBTableType.bott_DocumentLines
                    lRetCode = oUserTablesMD.Add
                    '// check for errors in the process
                    If lRetCode <> 0 Then
                        If lRetCode = -1 Then
                        Else
                            B1Connections.diCompany.GetLastError(lRetCode, sErrMsg)
                            MsgBox(sErrMsg)
                        End If
                    Else
                        B1Connections.theAppl.StatusBar.SetText("Table: " & oUserTablesMD.TableName & " was added successfully", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success)
                    End If
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserTablesMD)
                    oUserTablesMD = Nothing
                    GC.Collect()
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try
    Thanks
    Regards
    Gorge

    Hi Gorge,
    The "Ref count error..." usually occurs in case of Meta Data objects not being properly cleared.  And yes, you have got the error in the right place, generally while creating tables / fields / UDOs.  For this, you just need to clear the Meta Data object (At times even DI objects like Record Set) once they are used.
    Eg: Release these objects in the below way in a Finally Block.
    System.Runtime.InteropServices.Marshal.ReleaseComObject(oRecordSet);
    Hope this helps.
    Regards,
    Satish

  • Record count per page , total record count per report in BI Publisher

    hi,
    In Oracle BI Publisher tool , can you please tell me how to display total record count of a report ? as well as how to display record count per page ?
    Thanks for your help
    Regards
    Gayathri

    check inbox. forwarded the updated template

  • Record Count Issue in Search page ?

    Hi Friends
    I am trying to display record count on Search page and I have the following code in
    The table has total of 62 Rows
    AM : for testing purpose, i am printing in log
    public void getISAGRecordCount()
    OAViewObject vo = (OAViewObject)getXXG2_ELIM_ISAGSView1(); //getXXG2ISAGSearchVO1();
    int fetchedRowCount = 0;
    vo.setMaxFetchSize(-1);
    vo.executeQuery();
    fetchedRowCount = vo.getRowCount();
    System.out.println("RowCount: "+ fetchedRowCount);
    IN PFR of CO: I am calling by this way
    am.invokeMethod("getISAGRecordCount");
    the Issue is
    for the first time, when i search  Based on search criteria, I know it should dispaly 10 records  but in the Log file i see the total Record Count of the Table     Ex; 62
    When i do the serach for the second time, based on search criteria, I know it should display 20 records, but the log file has 10 records ( previous search results)
    If I do the search for 3rd time, I see 2nd search results in log
    Any help in this issue, how to fix this?
    Thanks
    Ravi

    Hi,
    Please donot use getRowCount(), use getFetchedRowCount() and remove setMaxFetchSize(-1).
    Hope it will resolve your issue.
    Just for understanding of the concept:
    getFetchedRowCount() returns the number of rows cached in the view object -- including programmatically inserted rows.
    The getRowCount() implicitly execute a query against the database (if a query has not been executed yet)
    Regards,
    Reetesh Sharma

Maybe you are looking for

  • OLE in Reports 3.0.5

    Hi, I created a OLE object and created a link to a bitmap(logo). the path is correct, case doesnt matter. I ran and tested the report too, it is fine. But the next day, i try to open the report , it doesnt. Same with all the back up reports that i sa

  • Is there a way to rotate an array on the front panel?

    Is there a way to rotate an array on the front panel?  For example, I want element [0] to be at the bottom of an array that's expanded to show the elements vertically. Thanks in advance.

  • Ipad 3rd generation, are there any recalls on this device?

    I have an Ipad 3rd generation. It will not charge. went to the apple store, they ran diagnostic and said battery was fine, reset everything, said the firmware was fine. Thinks the problem is in the charge port or wire going to battery.  Is this a com

  • Change panel in japplet at runtime

    I am fairly new to java, but here is what i am trying to do. I would like to have a button, when pressed, change a panel in my japplet and repaint. is this possible? i do not know anything about tabbed panes (i leanred with 1.2) so i'd like to stay a

  • Advisor connector failed to send analysis data to management server

    We are using the online advisory server on the servers we can, we continue to get the following on multiple servers - "Advisor connector failed to send analysis data to management server"  Event Description: Failed to upload CAB to management server.