How to get the total record count in ODI

Hi
I have the interface the are file to DB.
The format is like this..
HEADER
DETAIL
TRAILER
Now will write the contains of file to DB,
But i have to insert the total count ie numberof record written from file to DB in my Trailer record.
can you tell me how can i get the total count of records in file and write it to trailer?
Also, I want the interface to rollback the data if something fails will loading the data from file., ie. if there are 100 records in file and 50 got transfer and something fails i want to rollabck the 50 records from DB.???
Thanks :)

Hi
You can design a flow for Full load flow and incremental flow from flat file to Table.
Create a table at target database like.. (create table with last_execution and palce the V_FULL_LOAD value and LAST_EXECUTION_DT columns in last_execution table)
Add faltfile as table in model, create a variable as V_FULL_LOAD and make sure that the default values is 01-01-1900
Create one more variable like V_LAST_EXECUTION_DATE (in this variable write a case statement that if V_FULL_LOAD value is 'Y" then full load should happen and same time you should check that V_FULL_LOAD column is balnk then write insert statment else write update statement to update last_execution_dt column, similar for 'N')
please provide your *personal mail ID*, i will send a doc file realted to your query.
we have to tables present in work repository (SNP_STEP and STEP_LOG tables) using tables we can get how many records are inserted/updated and we can find how many records are not transfer and gor error.
Thanks
Phani

Similar Messages

  • 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.

  • How to get a total record count before grouping?

    I need to group a report on a formula that does roughly the following:
    [record count] / ( [total record count] / 20 )
    What this acheives is to label each record with a number of 1 - 20 which I want to group on. Getting this figure is the easy part, what is not working is the fact that I cannot group from a formula that is calculated after grouping. I overcame a portion of this by using "Whilereadingrecords" (rather than "count", running totals, or while printing records) to acheive a record count.
    I can't figure out how to get a total record count done before grouping. Is there a way to do this with "WhileReadingRecords"?? Is this even possible?
    Thanks
    John

    Hi John, 
    The order of how Crystal does things dictates the order of which features you can use.  Crystal has a two pass method.  In the first pass it does things like passing the query, grouping, summarizing.  In the second pass it does formulas, formatting, etc. 
    Unfortunately Crystal does the Grouping before summarizing so what you want to do can't be done in Crystal.  The best way to get around this to either create a SQL Command or view/stored procedure that will do the summarizing for you.  Then in the report you can use it. 
    Hope this helps,
    Brian

  • How to Get the Total Page Count in XML Reports?

    Hi All,
    we have a requirement where we have to print Page X of Y(Total Page Count of the document).
    But whenever my header group resets the total count is also reseting.
    for e.g.
    I m getting the page 1 of 4, page 2 of 4, page 3 of 4, page 4 of 4 for my first record.
    same way i am getting page 1 of 3 ,page 2 of 3, page 3 of 3 for my second record.
    But the requirement is to display page 1 of 7, page 2 of 7, page 3 of 7, page 4 of 7 for the first header record.
    And page 5 of 7, page 6 of 7 and page 7of 7 for the second record.
    Is there any way to achieve this?
    Thanks,
    Sachin

    You might have better luck getting an answer here:
    BI Publisher

  • How to get the total record in the block before save them

    Hello,
    I need to recalculate the amout for all records in one block before saving them.
    How can I get it?
    Thanks for your helping

    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.

  • How To Get The Total Delivered Quantity of a Sales Order

    Hello All,
    I have a requirement of getting the total delivery quantity of the sales order .I have checked it in LIps table but I am getting partially delivered quantity for a schedule line item.Can any one tell me how to get the total delivered quantity.
    Regards,
    Pavani.

    Hi
    Check the Table:
    VBEP  - Sales Document: Schedule Line Data.
    Inside the table check the Quantity Fields.
    Regards,
    Sreeram

  • How to get the total number of pages printed in a report?

    Hi All,
    I have a requirement where I need to print a frame of fields only in the last page. Unfortunately I cannot use the 'Print Object On' property as it doesnt work in my case. So, I am planning to write a format trigger on the frame to return TRUE if the page is the last physical page. Now, I need to know how to get the total number of physical pages that will get printed in the report so that I can use this to manipulate the frame. I was planning to use the 'Total Physical Pages' built-in, but it seems like I can just use it to print in a field and I can't use this field's value anywhere in the plsql code (formula column function/format trigger) in the report. Is there anyway to get the total number of pages printed in the report which can be used in the report plsql code?
    Thanks,
    Srini.

    i found the solution, thanks

  • How to get the total pages in ALV report?

    Hi guys,
    Since I used page breaks can somebody please help me on how to get the total pages in ALV report?sincerely please...thanks guys.

    automatic display total page.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    r

  • How to Determine the "Total" Page Count on HP 2575 All-in-one printer?

    Looking at how to determine the "Total" Page Count on HP 2575 All-in-one printer?   I've seen directions for other HP printers but can't seem to find any for the HP 2575 All-in-one printer.  I am trying to find approximately how many pages my printer has printed since I've owned it.    Any help is much appreciated. 

    The manual says you should be able to use the Embedded Web Server to view statistics. 
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • How to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK?

    I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.

    I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.

  • How to get the previous record value in the current record plz help me...

    In my sql how to get the previous record value...
    in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
    Thanx in Advance
    with regards
    kotresh

    First of this not hte mysql or database forum so don;t repeate again.
    to get diff between two date in mysql use date_format() to convert them to date if they r not date type
    then use - (minus)to get diff.

  • How to get the total no.of fields count in TFS

    How to check this:
    You can define no more than 1,024 work item fields in the same team project collection, and you can set no more than 1,024 fields to
    reportable in all team project collections.
    I have created some new fields in my customized process template. How to get the field count to check this validation. Do we have any command for this since witadmin listfields does not give the total count info.
    Thanks
    Divya

    Hi Divya, 
    Thanks for your post.
    Try to get fields count in collection using below code snippet:
    TfsTeamProjectCollection tfs =
    new
    TfsTeamProjectCollection(new
    Uri("collectionURL"));
    tfs.EnsureAuthenticated();
    WorkItemStore workitemstore = tfs.GetService<WorkItemStore>();
    FieldDefinitionCollection fields = workitemstore.FieldDefinitions;
    // get fields count in this collection
    Console.WriteLine(fields.Count);
    //get each field name
    foreach(FieldDefinition
    field in fields)
    Console.WriteLine(field.Name);
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get the total execution time from a tkprof file

    Hi,
    I have a tkprof file. How can I get the total execution time. Going through the file i guess the sum of "Total Waited" would give the total time in the section "Elapsed times include waiting on following events:"
    . The sample of tkprof is given below.
    SQL ID: gg52tq1ajzy7t Plan Hash: 3406052038
    SELECT POSTED_FLAG
    FROM
    AP_INVOICE_PAYMENTS WHERE CHECK_ID = :B1 UNION ALL SELECT POSTED_FLAG FROM
      AP_PAYMENT_HISTORY APH, AP_SYSTEM_PARAMETERS ASP WHERE CHECK_ID = :B1 AND
      NVL(APH.ORG_ID, -99) = NVL(ASP.ORG_ID, -99) AND
      (NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'ALWAYS' OR
      (NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'CLEARING ONLY' AND
      APH.TRANSACTION_TYPE IN ('PAYMENT CLEARING', 'PAYMENT UNCLEARING')))
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute    442      0.08       0.13          0          0          0           0
    Fetch      963      0.22       4.72        350      16955          0         521
    total     1406      0.31       4.85        350      16955          0         521
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 173     (recursive depth: 1)
    Number of plan statistics captured: 1
    Rows (1st) Rows (avg) Rows (max)  Row Source Operation
             1          1          1  UNION-ALL  (cr=38 pr=3 pw=0 time=139 us)
             1          1          1   TABLE ACCESS BY INDEX ROWID AP_INVOICE_PAYMENTS_ALL (cr=5 pr=0 pw=0 time=124 us cost=6 size=12 card=1)
             1          1          1    INDEX RANGE SCAN AP_INVOICE_PAYMENTS_N2 (cr=4 pr=0 pw=0 time=92 us cost=3 size=0 card=70)(object id 27741)
             0          0          0   NESTED LOOPS  (cr=33 pr=3 pw=0 time=20897 us)
             0          0          0    NESTED LOOPS  (cr=33 pr=3 pw=0 time=20891 us cost=12 size=41 card=1)
             1          1          1     TABLE ACCESS FULL AP_SYSTEM_PARAMETERS_ALL (cr=30 pr=0 pw=0 time=313 us cost=9 size=11 card=1)
             0          0          0     INDEX RANGE SCAN AP_PAYMENT_HISTORY_N1 (cr=3 pr=3 pw=0 time=20568 us cost=2 size=0 card=1)(object id 27834)
             0          0          0    TABLE ACCESS BY INDEX ROWID AP_PAYMENT_HISTORY_ALL (cr=0 pr=0 pw=0 time=0 us cost=3 size=30 card=1)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                       350        0.15          4.33
      Disk file operations I/O                        3        0.00          0.00
      latch: shared pool                              1        0.17          0.17
    ********************************************************************************

    user13019948 wrote:
    Hi,
    I have a tkprof file. How can I get the total execution time.
    call count cpu elapsed disk query current rows
    total 1406 0.31 4.85 350 16955 0 521TOTAL ELAPSED TIME is 4.85 seconds from line above

  • How to get the total bytes read by windows media palyer?

    Using the wmp activeX control to play an avi format file, and using cvi's activeX tools to generate a wmp control. It can play. I'd like to know which method can get the bytes that read by wmp?
    Thanks.

    user13019948 wrote:
    Hi,
    I have a tkprof file. How can I get the total execution time.
    call count cpu elapsed disk query current rows
    total 1406 0.31 4.85 350 16955 0 521TOTAL ELAPSED TIME is 4.85 seconds from line above

  • How to get th displaye record count through SQL*Plus without result

    set lines 155
    set pages 100
    set autoprint on
    variable cv refcursor
    set serveroutput on size 1000000
    set timing on
    set feedback on
    set echo on
    exec proc_name (input1, input2, :cv);how to get the record count without resultset display in the sql*plus promt ...?
    plz help me....

    This is my earilier code
    set lines 155
    set pages 100
    set autoprint on
    variable cv refcursor
    set serveroutput on size 1000000
    set timing on
    set feedback on
    set echo on
    exec proc_name (input1, input2, :cv);
    Then i have tried to execute like this
    declare
    disp SYS_REFCURSOR;
    cv SYS_REFCURSOR;
    cnt number :=0;
    begin
    proc_name (input1, input2, :cv);
    FOR disp in cv --here cv is the set of record set
    LOOP
    --FETCH cv INTO disp;
    EXIT WHEN cv%NOTFOUND;
    cnt := cnt + 1;
    END LOOP;
    dbms_output.put_line(cnt);
    dbms_output.put_line(cv%rowcount);
    CLOSE cv;
    end;
    getting error...
    LOOP
    ERROR at line 8:
    ORA-06550: line 8, column 2:
    PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
    . ( % ; for
    The symbol "; was inserted before "LOOP" to continue.
    ORA-06550: line 13, column 2:
    PLS-00103: Encountered the symbol "DBMS_OUTPUT"
    ORA-06550: line 13, column 27:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( , * % & - + / at mod rem <an identifier>
    <a double-quoted delimited-identifier> <an exponent (**)> as
    from into || bulk
    I have set of executable procedure script for exec procedure1(input1, input2 :cv); , exec procedure1(input1, input2 :cv);,.... like that. But i want only the record count, while we execute all these scripts in the sql promt...How to do that one.. ?

Maybe you are looking for