Collection in trigger

Greetings,
Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production
I am writing a trigger as below but gives me error
CREATE OR REPLACE TRIGGER ABHI_TEST
BEFORE INSERT ON abhi_TAB
FOR EACH ROW
DECLARE
type abhi_trig_rec is record (
pcode number,
scode number,
c_type number,
MIN_VARIANCE float,
MAX_VARIANCE float,
FINAL_CHARGE float,
START_TIME_STAMP date,
END_TIME_STAMP date);
TYPE ABHI_TRIG IS VARRAY(50) OF abhi_trig_rec ;
  REV_trig ABHI_TRIG:=ABHI_TRIG();
BEGIN
SELECT pcode,scode,c_type, MIN_VARIANCE,MAX_VARIANCE,FINAL_CHARGE,START_TIME_STAMP,END_TIME_STAMP
bulk collect into REV_trig FROM NEW_TAB
WHERE rownum<40;
FOR i IN REV_trig.FIRST..REV_trig.LAST
LOOP
  {BUSINESS LOGIC}
END LOOP;
END;ERROR :- PLS-00597: expression 'REV_TRIG' in INTO list is of wrong type
Thanks in advance for any help

The workd CODE in the tag must be in lower case like this <font color=red>{noformat}{noformat}</font>
SELECT pcode,scode,c_type, MIN_VARIANCE,MAX_VARIANCE,FINAL_CHARGE,START_TIME_STAMP,END_TIME_STAMP
bulk collect into REV_trig FROM NEW_TAB
WHERE rownum<40;
For your version of oracle you need to have seperate collection type for each column in the select list. Which means you need to have 8 collection variable defined.
Something like thisselect pcode
, scode
, c_type
, min_variance
, max_variance
, final_charge
, start_time_stamp
, end_time_stamp
bulk
collect
into pcode_collection_var
, scode_collection_var
, c_type_collection_var
, min_variance_collection_var
, max_variance_collection_var
, final_charge_collection_var
, start_time_stamp_collection_var
, end_time_stamp_collection_var
from new_tab
where rownum < 40;
And What is this
where rownum < 40;
Why have you limited your rows based on rownum?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • WIP collection plan trigger

    Customer would like to apply a quality inspection hold between 140 to 150 sequence number and for the star items / config items that are configured using ATO Model “INTELLIX BMT 300 UNIT”.
    Please help us in setting a collection trigger for above requirement.

    Collection plan going to followin error on cloned Test serverlog, while it is workng fine on our Production server:Please post the details of the application release, database version and OS.
    Concurrent Manager encountered an error while attempting to start your immediate concurrent program &PROGRAM. Routine &ROUTINE received a return code of failure.Please check the CM log file for details about the error.
    Thanks,
    Hussein

  • Collecting the trigger frequency from a VME-bus integrator.

    The integrator gives result ( result = (VFC - offset/4)/50000 )(in V.s), calculated from VFC value and offset value, read in padr ( Port A Dtat Register ).
    I'd like to know the real meaning of both offset and VFC value. With it, I should be able to know real-time frequency, without fixed input voltage.

    I do appreciate the attention you show toward my problem. So here is what I know :
    The Integrators I'm using are specialy built by National Instrument for CERN/LHC.
    They supply Voltage mesurement (*in Volt.Second, that's why I was a little bit dippointed) whith 2 32 bit words : one for voltage integerating counts and one for the "offset" .ie. the time elapsed since last mesurement. I didn't know this last was only in us. Now it's ok. I'm always expecting for documents on that topic.
    Regards.

  • How to use counter output pulses to trigger analog input?

    Hello all,
    I hope the kind people using this forum can help me, a lowly beginner LV programmer! I have been attempting to create a VI that produces a user defined number of TTL pulses, separated by every n seconds. Each TTL would be outputted to a stimulator, which in turn generates its own TTL. Using the stimulator-generated TTL, I would like to trigger finite analog data acquisition (e.g. for every TTL, trigger the collection of a data sweep that contains 4000 samples (collected at 4000 Hz), with 1000 samples collected pre-trigger. I would like to also be able to see each data sweep as it is triggered on a chart. As I understand things (lots of online/book/forum reading), I should be using the counter output to generate my TTL pulses, and syncing each counter produced TTL with analog input, as well as using a reference trigger. Also, the AI part should be started first, so that I don' t miss any counter outputs. If it matters, I also need to use one of the AI channels to acquire the TTL, so I can see my stimulator-induced responses to the stimulator in time.
    I am able to generate the TTL pulses from the counter output, but I am having a problem with the AI part. I am unsure how to sync the counter output with AI. Also, since I need to acquire pre-trigger samples, I would be needing to acquire samples continuously, but when I set 'continuous samples' on daqmx timing, the VI doesn't work (hence why's its set to 'finite samples').
     I hope someone out there can help, as I have been at this for what seems ages, with limited success. I am using a USB-6259 and LabView v8.2. Thanks!
    Attachments:
    RC001 v_1.vi ‏49 KB

    Hello,
    Due to the fact that analog tasks themselves are not retriggerable, a
    pulse train produced by a counter is always used as the sample clock
    for the analog input task in order to recreate a retriggerable effect
    for analog input. This can be done by creating a finite pulse train set
    to retriggerable using the DAQmx Trigger Property Node, or the pulse
    train could be continuous and just be gated by another signal. Neither
    of these methods can be properly applied in hardware to create a
    retriggerable reference trigger. You can however implement something
    similar in software by just stopping and restarting your reference
    triggered analog input task within a loop. There will be some delay
    between when the task is stopped and restarted, as these events require
    software intervention, but if there is enough time between when each
    trigger signal is generated, there should not be any noticeable delay
    or missed samples.
    I have attached an example of this!
    Mark B
    ===If this fixes your problem, mark as solution!===
    Attachments:
    RC001 v_1mod.vi ‏25 KB

  • Memory leak/overload when looping by index over a large query and updating each DB record

    I am importing a CSV file into a temporary table and then running a select query that joins my actual database table with the temporary table, looking for any changes in the data. If changes exist, the select query is looped from 1 to #recordCount# and an update is applied to each record via cfquery. It runs very quickly (much more quickly than looping the query itself), but my memory spikes and overloads after about 1500 updates are completed. I need to be able to do upwards of 20000 at a time, without killing my system. I have tried manually setting the runtime garbage collection to trigger after X number of loops, but that doesn't seem to help. I am running CF8. See below for loop example:
    <cfloop from="1" to="#updatedRecordsQuery.recordCount#" index="a">
    <cftry>
                    <cfquery datasource="#db#" name="doUpdate">
                        UPDATE
                            CI
                        SET
                            firstname = <cfqueryparam cfsqltype="cf_sql_varchar" value="#updatedRecordsQuery.firstname[a]#" />,
                            lastname = <cfqueryparam cfsqltype="cf_sql_varchar" value="#updatedRecordsQuery.lastname[a]#" />,
                            etc, for about 15 various fields
                        FROM
                            client_info CI
                        WHERE
                            CI.client_id = <cfqueryparam cfsqltype="cf_sql_integer" value="#updatedRecordsQuery.client_id[a]#" />
                    </cfquery>
                    <cfcatch type="database">
                        <cfset local.updateErrorList = listappend(local.updateErrorList,updatedRecordsQuery.client_id[a]) />
                        <cfset local.error = true />
                    </cfcatch>
               </cftry>
    </cfloop>

    I would suggest to use select update instead of looping over query object and update each row one-by-one.
    Procedure:
    - Insert your CSV data into temp table.
    - Use a select update SQL query to update the changed data instead of looping over a select query.
    Example:
    UPDATE
       Table
    SET
       Table.col1 = other_table.col1,
       Table.col2 = other_table.col2
    FROM
       Table
    INNER JOIN
      other_table
    ON
       Table.id = other_table.id
    NOTE: You can put all your scripts in a Procedure.

  • Keeping Heap Usage lower than a given threshold level

    Hello,
    We are trying to find out which are the most suitable parameters for the gc for our application.
    We have an application using a 1GB heap.
    We have tried different combinations of parameters, such as generational gc vs single spaced, different nursery sizes, dynamic gc with priority on memory throughput vs pause time, …
    We plot the usage of the heap before and after the gc has run.
    There is one common thing that we see with all the different configurations: The heap usage always reaches levels of around 95% of the heap size.
    We would like to find a way to reduce the heap usage (even if it increases the pause times. If the pause time is higher, we will analyze the final impact on our application responsiveness and decide afterwards).
    The ideal would be to find a way to keep it under a given threshold level (let’s say, 70% of the total heap size).
    Your ideas will be very welcome.
    Thanks and regards,
    Ramiro

    I'm not sure I understand your question, but I'll give you an answer and
    you can tell me if it helped :-).
    Basically the gc doesn't trigger until the heap is full. For
    generational GCs, nursery collections will trigger when the nursery is
    full. Some objects get promoted, and when the heap is entirely full an
    old-space collection is performed.
    So you can't really get JRockit to gc before the heap is full.
    If you want to know how small heap you can use, look at how much space
    is used after a full gc. Add some marigin of error, then use that value
    for -Xmx.
    I don't know what tool you're using for plotting the heap usage, but you
    could use JRockit's Management Console (bin/jrcc). Also, if you want to
    know where your heap memory is going, try the memleak detector from
    http://dev2dev.bea.com/jrockit/tools.html.
    Regards //Johan
    Ramiro Alcazar wrote:
    Hello,
    We are trying to find out which are the most suitable parameters for the gc for our application.
    We have an application using a 1GB heap.
    We have tried different combinations of parameters, such as generational gc vs single spaced, different nursery sizes, dynamic gc with priority on memory throughput vs pause time, ???
    We plot the usage of the heap before and after the gc has run.
    There is one common thing that we see with all the different configurations: The heap usage always reaches levels of around 95% of the heap size.
    We would like to find a way to reduce the heap usage (even if it increases the pause times. If the pause time is higher, we will analyze the final impact on our application responsiveness and decide afterwards).
    The ideal would be to find a way to keep it under a given threshold level (let???s say, 70% of the total heap size).
    Your ideas will be very welcome.
    Thanks and regards,
    Ramiro

  • Dispatching capturing phase events

    Hi,
    The MC contains a lot of added children. I would like to
    inform all of them
    about action performed on one of them. When function
    dispatchEvent() is used
    then only parent object receives event and additionaly only
    when
    Event.bubbles is set to true. I tried to receive event in
    parent object and
    then trigger another one with Event.bubbles set to false but
    children
    objects did not receive it. Do I have to walk through
    children collection
    and trigger event on each of then separately?
    Isn't there any method of triggering event in one place in
    parent object
    which will be delivered to others objects? (Capturing phase
    of event
    propagation).
    Another, similar issue:
    Is there method of triggering event in one of the children
    and deliver it to
    other children from the same display collection?
    Regards,
    Marek

    In the child objects can't you add an event listener to the
    parent, which dispaches an Event when it receives one from one of
    the children. You could use a custom event class that could carry
    the instance name/reference to the child that dispached the event
    origionally.
    You could make all the children listen to events from each
    other, but this would result in many more event listeners and
    probably a performance hit.

  • Need to increase performance-bulk collect in cursor with limit and in the for loop inserting into the trigger table

    Hi all,
    I have a performance issue in the below code,where i am trying to insert the data from table_stg into target_tab and in parent_tab tables and then to child tables via cursor with bulk collect .the target_tab and parent_tab are huge tables and have a row wise trigger enabled on it .the trigger is mandatory . This timetaken for this block to execute is 5000 seconds.Now my requirement is to reduce it to 5 to 10 mins.
    can someone please guide me here.Its bit urgent .Awaiting for your response.
    declare
    vmax_Value NUMBER(5);
      vcnt number(10);
      id_val number(20);
      pc_id number(15);
      vtable_nm VARCHAR2(100);
      vstep_no  VARCHAR2(10);
      vsql_code VARCHAR2(10);
      vsql_errm varchar2(200);
      vtarget_starttime timestamp;
      limit_in number :=10000;
      idx           number(10);
              cursor stg_cursor is
             select
                   DESCRIPTION,
                   SORT_CODE,
                   ACCOUNT_NUMBER,
                     to_number(to_char(CORRESPONDENCE_DATE,'DD')) crr_day,
                     to_char(CORRESPONDENCE_DATE,'MONTH') crr_month,
                     to_number(substr(to_char(CORRESPONDENCE_DATE,'DD-MON-YYYY'),8,4)) crr_year,
                   PARTY_ID,
                   GUID,
                   PAPERLESS_REF_IND,
                   PRODUCT_TYPE,
                   PRODUCT_BRAND,
                   PRODUCT_HELD_ID,
                   NOTIFICATION_PREF,
                   UNREAD_CORRES_PERIOD,
                   EMAIL_ID,
                   MOBILE_NUMBER,
                   TITLE,
                   SURNAME,
                   POSTCODE,
                   EVENT_TYPE,
                   PRIORITY_IND,
                   SUBJECT,
                   EXT_PRD_ID_TX,
                   EXT_PRD_HLD_ID_TX,
                   EXT_SYS_ID,
                   EXT_PTY_ID_TX,
                   ACCOUNT_TYPE_CD,
                   COM_PFR_TYP_TX,
                   COM_PFR_OPT_TX,
                   COM_PFR_RSN_CD
             from  table_stg;
    type rec_type is table of stg_rec_type index by pls_integer;
    v_rt_all_cols rec_type;
    BEGIN
      vstep_no   := '0';
      vmax_value := 0;
      vtarget_starttime := systimestamp;
      id_val    := 0;
      pc_id     := 0;
      success_flag := 0;
              vstep_no  := '1';
              vtable_nm := 'before cursor';
        OPEN stg_cursor;
              vstep_no  := '2';
              vtable_nm := 'After cursor';
       LOOP
              vstep_no  := '3';
              vtable_nm := 'before fetch';
    --loop
        FETCH stg_cursor BULK COLLECT INTO v_rt_all_cols LIMIT limit_in;
                  vstep_no  := '4';
                  vtable_nm := 'after fetch';
    --EXIT WHEN v_rt_all_cols.COUNT = 0;
        EXIT WHEN stg_cursor%NOTFOUND;
    FOR i IN 1 .. v_rt_all_cols.COUNT
      LOOP
       dbms_output.put_line(upper(v_rt_all_cols(i).event_type));
        if (upper(v_rt_all_cols(i).event_type) = upper('System_enforced')) then
                  vstep_no  := '4.1';
                  vtable_nm := 'before seq sel';
              select PC_SEQ.nextval into pc_id from dual;
                  vstep_no  := '4.2';
                  vtable_nm := 'before insert corres';
              INSERT INTO target1_tab
                           (ID,
                            PARTY_ID,
                            PRODUCT_BRAND,
                            SORT_CODE,
                            ACCOUNT_NUMBER,
                            EXT_PRD_ID_TX,         
                            EXT_PRD_HLD_ID_TX,
                            EXT_SYS_ID,
                            EXT_PTY_ID_TX,
                            ACCOUNT_TYPE_CD,
                            COM_PFR_TYP_TX,
                            COM_PFR_OPT_TX,
                            COM_PFR_RSN_CD,
                            status)
             VALUES
                            (pc_id,
                             v_rt_all_cols(i).party_id,
                             decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                             v_rt_all_cols(i).sort_code,
                             'XXXX'||substr(trim(v_rt_all_cols(i).ACCOUNT_NUMBER),length(trim(v_rt_all_cols(i).ACCOUNT_NUMBER))-3,4),
                             v_rt_all_cols(i).EXT_PRD_ID_TX,
                             v_rt_all_cols(i).EXT_PRD_HLD_ID_TX,
                             v_rt_all_cols(i).EXT_SYS_ID,
                             v_rt_all_cols(i).EXT_PTY_ID_TX,
                             v_rt_all_cols(i).ACCOUNT_TYPE_CD,
                             v_rt_all_cols(i).COM_PFR_TYP_TX,
                             v_rt_all_cols(i).COM_PFR_OPT_TX,
                             v_rt_all_cols(i).COM_PFR_RSN_CD,
                             NULL);
                  vstep_no  := '4.3';
                  vtable_nm := 'after insert corres';
        else
              select COM_SEQ.nextval into id_val from dual;
                  vstep_no  := '6';
                  vtable_nm := 'before insertcomm';
          if (upper(v_rt_all_cols(i).event_type) = upper('REMINDER')) then
                vstep_no  := '6.01';
                  vtable_nm := 'after if insertcomm';
              insert into parent_tab
                 (ID ,
                 CTEM_CODE,
                 CHA_CODE,            
                 CT_CODE,                           
                 CONTACT_POINT_ID,             
                 SOURCE,
                 RECEIVED_DATE,                             
                 SEND_DATE,
                 RETRY_COUNT)
              values
                 (id_val,
                  lower(v_rt_all_cols(i).event_type), 
                  decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                  'Email',
                  v_rt_all_cols(i).email_id,
                  'IADAREMINDER',
                  systimestamp,
                  systimestamp,
                  0);  
         else
                vstep_no  := '6.02';
                  vtable_nm := 'after else insertcomm';
              insert into parent_tab
                 (ID ,
                 CTEM_CODE,
                 CHA_CODE,            
                 CT_CODE,                           
                 CONTACT_POINT_ID,             
                 SOURCE,
                 RECEIVED_DATE,                             
                 SEND_DATE,
                 RETRY_COUNT)
              values
                 (id_val,
                  lower(v_rt_all_cols(i).event_type), 
                  decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                  'Email',
                  v_rt_all_cols(i).email_id,
                  'CORRESPONDENCE',
                  systimestamp,
                  systimestamp,
                  0); 
            END if; 
                  vstep_no  := '6.11';
                  vtable_nm := 'before chop';
             if (v_rt_all_cols(i).ACCOUNT_NUMBER is not null) then 
                      v_rt_all_cols(i).ACCOUNT_NUMBER := 'XXXX'||substr(trim(v_rt_all_cols(i).ACCOUNT_NUMBER),length(trim(v_rt_all_cols(i).ACCOUNT_NUMBER))-3,4);
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 'IB.Correspondence.AccountNumberMasked',
                 v_rt_all_cols(i).ACCOUNT_NUMBER);
             end if;
                  vstep_no  := '6.1';
                  vtable_nm := 'before stateday';
             if (v_rt_all_cols(i).crr_day is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Day',
                 'IB.Crsp.Date.Day',
                 v_rt_all_cols(i).crr_day);
             end if;
                  vstep_no  := '6.2';
                  vtable_nm := 'before statemth';
             if (v_rt_all_cols(i).crr_month is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Month',
                 'IB.Crsp.Date.Month',
                 v_rt_all_cols(i).crr_month);
             end if;
                  vstep_no  := '6.3';
                  vtable_nm := 'before stateyear';
             if (v_rt_all_cols(i).crr_year is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Year',
                 'IB.Crsp.Date.Year',
                 v_rt_all_cols(i).crr_year);
             end if;
                  vstep_no  := '7';
                  vtable_nm := 'before type';
               if (v_rt_all_cols(i).product_type is not null) then
                  insert into child_tab
                     (COM_ID,                                            
                     KEY,                                                                                                                                        
                     VALUE)
                  values
                    (id_val,
                     'IB.Product.ProductName',
                   v_rt_all_cols(i).product_type);
                end if;
                  vstep_no  := '9';
                  vtable_nm := 'before title';         
              if (trim(v_rt_all_cols(i).title) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE )
              values
                (id_val,
                 'IB.Customer.Title',
                 trim(v_rt_all_cols(i).title));
              end if;
                  vstep_no  := '10';
                  vtable_nm := 'before surname';
              if (v_rt_all_cols(i).surname is not null) then
                insert into child_tab
                   (COM_ID,                                            
                   KEY,                                                                                                                                          
                   VALUE)
                values
                  (id_val,
                  'IB.Customer.LastName',
                  v_rt_all_cols(i).surname);
              end if;
                            vstep_no  := '12';
                            vtable_nm := 'before postcd';
              if (trim(v_rt_all_cols(i).POSTCODE) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Customer.Addr.PostCodeMasked',
                  substr(replace(v_rt_all_cols(i).POSTCODE,' ',''),length(replace(v_rt_all_cols(i).POSTCODE,' ',''))-2,3));
              end if;
                            vstep_no  := '13';
                            vtable_nm := 'before subject';
              if (trim(v_rt_all_cols(i).SUBJECT) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Correspondence.Subject',
                  v_rt_all_cols(i).subject);
              end if;
                            vstep_no  := '14';
                            vtable_nm := 'before inactivity';
              if (trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) is null or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '3' or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '6' or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '9') then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Correspondence.Inactivity',
                  v_rt_all_cols(i).UNREAD_CORRES_PERIOD);
              end if;
                          vstep_no  := '14.1';
                          vtable_nm := 'after notfound';
        end if;
                          vstep_no  := '15';
                          vtable_nm := 'after notfound';
        END LOOP;
        end loop;
                          vstep_no  := '16';
                          vtable_nm := 'before closecur';
        CLOSE stg_cursor;
                          vstep_no  := '17';
                          vtable_nm := 'before commit';
        DELETE FROM table_stg;
      COMMIT;
                          vstep_no  := '18';
                          vtable_nm := 'after commit';
    EXCEPTION
    WHEN OTHERS THEN
      ROLLBACK;
      success_flag := 1;
      vsql_code := SQLCODE;
      vsql_errm := SUBSTR(sqlerrm,1,200);
      error_logging_pkg.inserterrorlog('samp',vsql_code,vsql_errm, vtable_nm,vstep_no);
      RAISE_APPLICATION_ERROR (-20011, 'samp '||vstep_no||' SQLERRM:'||SQLERRM);
    end;
    Thanks

    Its bit urgent
    NO - it is NOT urgent. Not to us.
    If you have an urgent problem you need to hire a consultant.
    I have a performance issue in the below code,
    Maybe you do and maybe you don't. How are we to really know? You haven't posted ANYTHING indicating that a performance issue exists. Please read the FAQ for how to post a tuning request and the info you need to provide. First and foremost you have to post SOMETHING that actually shows that a performance issue exists. Troubleshooting requires FACTS not just a subjective opinion.
    where i am trying to insert the data from table_stg into target_tab and in parent_tab tables and then to child tables via cursor with bulk collect .the target_tab and parent_tab are huge tables and have a row wise trigger enabled on it .the trigger is mandatory . This timetaken for this block to execute is 5000 seconds.Now my requirement is to reduce it to 5 to 10 mins.
    Personally I think 5000 seconds (about 1 hr 20 minutes) is very fast for processing 800 trillion rows of data into parent and child tables. Why do you think that is slow?
    Your code has several major flaws that need to be corrected before you can even determine what, if anything, needs to be tuned.
    This code has the EXIT statement at the beginning of the loop instead of at the end
        FETCH stg_cursor BULK COLLECT INTO v_rt_all_cols LIMIT limit_in;
                  vstep_no  := '4';
                  vtable_nm := 'after fetch';
    --EXIT WHEN v_rt_all_cols.COUNT = 0;
        EXIT WHEN stg_cursor%NOTFOUND;
    The correct place for the %NOTFOUND test when using BULK COLLECT is at the END of the loop; that is, the last statement in the loop.
    You can use a COUNT test at the start of the loop but ironically you have commented it out and have now done it wrong. Either move the NOTFOUND test to the end of the loop or remove it and uncomment the COUNT test.
    WHEN OTHERS THEN
      ROLLBACK;
    That basically says you don't even care what problem occurs or whether the problem is for a single record of your 10,000 in the collection. You pretty much just throw away any stack trace and substitute your own message.
    Your code also has NO exception handling for any of the individual steps or blocks of code.
    The code you posted also begs the question of why you are using NAME=VALUE pairs for child data rows? Why aren't you using a standard relational table for this data?
    As others have noted you are using slow-by-slow (row by row processing). Let's assume that PL/SQL, the bulk collect and row-by-row is actually necessary.
    Then you should be constructing the parent and child records into collections and then inserting them in BULK using FORALL.
    1. Create a collection for the new parent rows
    2. Create a collection for the new child rows
    3. For each set of LIMIT source row data
      a. empty the parent and child collections
      b. populate those collections with new parent/child data
      c. bulk insert the parent collection into the parent table
      d. bulk insert the child collection into the child table
    And unless you really want to either load EVERYTHING or abandon everything you should use bulk exception handling so that the clean data gets processed and only the dirty data gets rejected.

  • How do I perform a trigger that collect the data for every rising edge continuously and then automatically put the data in a .xls file??

    I need to collect the data for every rising edge a trigger perfoms. So far I could collect the data but it seems that it only collect the data in the start of triggering, but not continuously. I also want to put the data in an excel spreadsheet and automatically add new set of data when the next rising edge occur. Please help.
    thanks a lot.

    LabWindows/CVI actually ships with a comprehensive set of examples for just about every area of programming you can use it in, including triggered analog data acquisition and ActiveX control of Microsoft Excel for data logging. Go to the following two directories on your computer to find respective examples for the two areas you are inquiring about:
    1) C:\MeasurementStudio\CVI\samples\DAQ\Ai\DAQsingleBufExtTrig.PRJ
    2) C:\MeasurementStudio\CVI\samples\activex\excel\excel2000dem.prj
    Just make sure to study the examples carefully so that you fully understand the processes followed for triggered analog acquisition and the process of launching an ActiveX automation server for control, and then you should be able to merge the concepts shown in both of the example
    s to make the application you desire.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • How to trigger creation of collective orders

    Hi,
    How to trigger the creation of Collective orders.
    regards

    Hi,
    Collective Orders
    Use
    In a collective order, planned orders or production orders are linked to one another over several production levels. Each order in the collective order has its own order number. If subassemblies are produced directly for superior orders within a production process, without physically entering the warehouse, it is useful to have a representation via collective orders.
    The components for which separate production orders are created in the collective order are called directly produced components (see Creating Collective Orders)
    Prerequisites
    A collective order cannot be created for components that have one of the following indicators set:
    · Co-product
    · By-product
    · Alternative item with strategy 2
    · Alternative item with usage probability 0
    · Discontinued
    · Follow-up material
    · Intra material
    Features
    Collective orders offer the following advantages:
    · Integrated view of a production process
    Collective orders make it possible to represent different levels of the production process together in the system. The production process can be viewed as an integrated whole.
    · Separate order number for every order
    Every level in a collective order represents a separate production order/planned order. Every production order/planned order has its own order number. This enables you to process the entire collective order, a subtree in the collective order or an individual order.
    · No placements in storage or removals from storage between production levels
    Within a collective order stock movements only take place for the leading order (that is, the order that is at the highest production level) and not for directly produced components. This makes it easier to maintain the collective order in comparison with several individual orders. A further advantage is a more realistic representation of the costs of the production process, since subordinate orders can be directly assigned and settled to superior orders.
    · Business functions simultaneously for several orders
    Certain business transactions can be carried out simultaneously for several orders. Releasing an order that belongs to a collective order has the effect that all the hierarchically subordinate orders are released simultaneously.
    · Automatic change to dependent orders
    Changes to an order automatically affect dependent orders / components affecting orders. For example, if you change the order quantity in an order then
    ¡ the relevant quantity changes are automatically made to dependent orders
    ¡ the requirements quantity of the directly produced component is automatically changed.
    In the collective order, you also have the option of manufacturing directly produced material in a different plant to the planning plant.
    · Set status in leading order
    If you make changes in subordinate orders that have an affect on the status, then the system sets the corresponding status in the order header of the leading order in the collective order as follows:
    u2013 CFCO Confirmation in collective order
    u2013 GMCO Goods movements in collective order
    u2013 RLNE Release taken place in network
    In this way you are informed about changes in the whole collective order.
    · Reading master data
    You can copy the routing data and BOM data to the order again. You can find more information in Read master data.
    Example
    You want to produce a pump. The BOM for the pump contains a pressure regulating valve and a spiral casing. You want to enter these two components in separate production orders, but you do not want them to be posted to stock.
    You set the special procurement type to direct production in the material master record for the pressure regulating valve and the spiral casing, so that production occurs using a collective order.
    When you create a production order for the pump, a collective order is automatically created, which contains subordinate production orders for the pressure regulating valve and the spiral casing.
    Creation of Collective Orders
    Use
    Collective orders are only created if the special procurement type is set to direct production in the components for which the separate production orders are to be created (materials planning area in the material master).
    In the standard system, 52 is the special procurement type for direct production (that is, for components that are produced within a collective order).
    To create a collective order, you must use an order type with internal number assignment.
    Hope this helps.
    Regards,
    Tejas

  • Partner profile settings - Trigger Immediate or Collect Idocs ??

    Hi All,
    We have EDI Setup between SAP and a EDI system and Idocs flowing with port type TCP/IP connection.
    we are facing issue at some times where in the Idoc is created and is in status 03 / 12 (trfc queue is cleared) but not found in the EDI system.
    what I have observed is the issue has occurred for only few vendors where partner profile setting in trigger immediately
    and it has not occurred t for every Idoc created, only some Idocs were missing in EDI system.
    issue was not present in case  where partner profile setting in collect Idocs.
    So it that do we have a best practice to set partner profile to collect Idocs (packet size ~ 20) when sending to EDI subsystem?

    Hi,
    It seems the issue is not because of your partner profile setting since your status of the IDOC is 03 0r 12.
    Output mode 'Transfer Idoc Immediate': Single Idoc is transfered immediately to the EDI system when the output triggered
    'Collect Idoc': Idocs generated for the particular message type will be collected in a single file and are triggered to  EDI system at a scheduled time. Here no of Idocs sent in a file will be decied based on packet size.
    It may be problem with your network connectivity.If are using a EDI substem then you use file port not trfc port.
    Check how the EDI sytem is reading the Idoc files which are created in R/3 OS level is it through FTP???
    Regards
    Praveen

  • Multiple Trigger Level Data Collection

    I'm having some difficulty with a unique data collection problem. I'm using DAQ Assistant to collect and display voltage data on a graph and in numeric indicators. I need to add functionality, so that when the user clicks a control, the incoming data is sampled and shown in a table. Each sample should occur at a succesively higher trigger level-- i.e., 1st sample when channel 0 is near 1 V, 2nd sample at 2 V etc... Is this possible using Labview 8.6? I have experimented with the Trigger and Gate function, but have been unable to trigger the manual trigger at successively higher levels. Any help or ideas would be appreciated! 

    Hi Sailorguy,
    Please have a look at this forum and see if it helps. Thanks!
    Ipshita C.
    National Instruments
    Applications Engineer

  • How do I know the daq card is collecting data i.e. has been triggered trigger

    I want to alert the user that the daq card is collecting data after he pushes the trigger switch.  I wish to update a message text box when it has been triggered.  Thanks,  PCI-6221 37 pin

    You could use something like this, to ensure that at some specific point in your code a string indicator on the front panel is updated.  After placing the string indicator, right click on it go to Create>>Proprety Node>>Text>>Text.  The string indicator will update to the input of this property node when this sequence structure is reached.  Does that help?
    Regards,
    Shane C
    Regards,
    Shane C
    Applications Engineer
    National Instruments

  • ORA-06531:collection error in trigger.

    We are using DBMS_XMLSave to insert data into an object nested view. Error ORA-06531 causes the trigger to fail when trying to access the collection count.. Below is the XML, view and trigger. What is missing or are we running into a bug?
    Thanks
    ****************************** XML ****************************
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW>
    <ArrestNumber>2</ArrestNumber>
    <IMErrors>
    <IMErrors_ITEM>
    <ResponseErrorCode>CODE 2</ResponseErrorCode>
    <ResponseErrorDesc>DESC 2</ResponseErrorDesc>
    </IMErrors_ITEM>
    <IMErrors_ITEM>
    <ResponseErrorCode>CODE 1</ResponseErrorCode>
    <ResponseErrorDesc>DESC 1</ResponseErrorDesc>
    </IMErrors_ITEM>
    </IMErrors>
    </ROW>
    </ROWSET>
    ************************* VIEW ****************************
    CREATE OR REPLACE TYPE sjs.imres_error_type AS OBJECT
    ("ResponseErrorCode"     VARCHAR2(10),
    "ResponseErrorDesc"     VARCHAR2(4000))
    CREATE OR REPLACE TYPE sjs.imres_errors_type AS TABLE OF imres_error_type
    CREATE OR REPLACE VIEW sjs.imresponse
    AS SELECT ith.a_id AS "ArrestNumber",
    CAST(MULTISET(SELECT ire.errorcode,
    ire.errordesc
    FROM sjs.imresponseerrors ire
    WHERE ire.ith_id = ith.ith_id) AS imres_errors_type) AS "IMerrors"
    FROM sjs.imtransactionhistory ith
    ************************* TRIGGER ****************************
    CREATE OR REPLACE TRIGGER sjs.imresponse_new INSTEAD OF INSERT ON sjs.imresponse FOR EACH ROW
    DECLARE
    error_list      imres_errors_type;
    error_t      imres_error_type;
    ith_id_holder NUMBER(18);
    cnt          NUMBER;
    BEGIN
    INSERT INTO imtransactionhistory(a_id,interfacetransaction,ith_nysid,ith_fbi,ith_cjtn)
    VALUES(:new."ArrestNumber",'PENDING','PENDING','PENDING','PENDING');
    SELECT sjs.ith_sequence.currval INTO ith_id_holder FROM dual;
    error_list := :new."IMerrors";
    cnt := error_list.count;
    -- FOR i IN 1..cnt LOOP
    -- error_t := error_list(i);
    -- INSERT INTO imresponseerrors(ith_id,errorcode,errordesc)
    -- VALUES(ith_id_holder,error_t."ResponseErrorCode",error_t."ResponseErrorDesc");
    -- END LOOP;
    END;
    ************************* ERROR ****************************
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
    'oracle.jdbc.driver.OracleSQLException: ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SJS.IMRESPONSE_NEW", line 11
    ORA-04088: error during execution of trigger 'SJS.IMRESPONSE_NEW'
    ' encountered during processing ROW element 0. All prior XML row changes were rolled back. in the XM
    ORA-06512: at "SJS.XML_UTIL", line 72
    ORA-06512: at "SJS.IMRES", line 35
    ORA-06512: at line 6

    Frank
    error_list is a collection. What happens if you use an index with it? E.G.
    error_list(1) := :new."IMerrors";
    Cheers, APC

  • Trigger Points in Collective Orders

    Hi
    Need a help. I am working with collective orders and my requirement..the order should be released automatically once the previous linked order is confirmed.
    Could you pl let me know " How can i use the trigger point functionlity in the same. I have worked with the Trigger points where next operation is released after the previos is confirmed but tht is in one routing .
    Thanks in advance

    You can setup external job (maintain variant in co41) to release the order automatically once the previous order confirms.

Maybe you are looking for

  • Ultrabook/Notebook freezing and making loud buzzing noise

    I just received via UPS a HP Pavilion 11 x2 PC 11-h010nr for my daughter for Christmas.  I decided to let her open it as her one before Christmas present and I am glad I did.  She went into xbox music to listen to her new beats audio sound.  On about

  • I cannot install/upgrade Adobe Flash Player

    An email came to me with something sent on Adobe.  I could not open it because I needed an update on my Adobe Flash player.  I tried to update it and nearly finish with the installation when I keep getting the message that I need to close Safari  whi

  • Financial Reports -  Task- Setup User POV

    Hi In FR when we select the members for a User POV using Task->Setup User POV........................Does the list of members apply to this particular report or all reports with this database connection. For every report the User prompt Members for a

  • How to convert processScope to Session Scope.

    Hi, Could you please tell me any one, how to convert processScope to Session Scopde. because i need to pass 1 processScope value to Servlet. but servlets don't know ProcessScope value. for this i need to convert processScope value into Session scope

  • ITunes will not sync with iPod anymore

    A few days ago, when I started up my iPod, it gave me a message that I needed to connect with iTunes to restore it. I did that, and it's back to normal, but now when I try to put my music back on my iPod, I get an error message that says "The iPod ca