Passing  a set of records

hello
I have a doubt , i have a stored procedure that make a transformation of data and insert in another table .Ok that works ok, but only works to a single row .
Now I want to modify my proc , now i want to receive a set of rows , How can I do this ?
Thank you

If your transformation cannot be done in pure sql, consider a pipelined object collection.
INSERT INTO target_table (target_columns)
SELECT object_attributes
  FROM TABLE (
         pipelined_function (
           CURSOR (
             SELECT source_columns
               FROM source_table)));Mark Rittman has an excellent article on this.
http://www.rittman.net/archives/000923.html

Similar Messages

  • Pass a set of Records form Form to a Report

    Hi,
    Lets say that I've already fetched a set of records on Oracle Form, and I want to pass these reocrds to a Report " on the Report I dont wana use range or where clause to give me these recods"
    Any ideas how to do that please?
    Thanks!

    Passing a (Forms) Record Group as DATA_PARAMETER to Reports:
    First example:
    Forms code (in WHEN-BUTTON-PRESSED trigger) calls reports module
    and sends record group "rg_dept" (populated from :SYSTEM.LAST_QUERY) as parameter:
    DECLARE
    rg_id_l RECORDGROUP;
    rg_name_l VARCHAR2 (30) := 'RG_DEPT';
    status_l NUMBER;
    pl_id_l PARAMLIST;
    pl_name_l VARCHAR2 (30) := 'PARAM_LIST';
    BEGIN
    rg_id_l := FIND_GROUP (rg_name_l);
    IF NOT ID_NULL (rg_id_l) THEN
    DELETE_GROUP (rg_id_l);
    END IF;
    rg_id_l := CREATE_GROUP_FROM_QUERY (rg_name_l, :SYSTEM.LAST_QUERY);
    status_l := POPULATE_GROUP (rg_id_l);
    IF status_l <> 0 THEN
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    pl_id_l := GET_PARAMETER_LIST (pl_name_l);
    IF NOT ID_NULL (pl_id_l) THEN
    DESTROY_PARAMETER_LIST (pl_id_l);
    END IF;
    pl_id_l := CREATE_PARAMETER_LIST (pl_name_l);
    ADD_PARAMETER (pl_id_l, 'Q_1', DATA_PARAMETER, rg_name_l);
    RUN_PRODUCT (REPORTS, 'rec_group', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id_l, NULL);
    END;
    Reports module must have query with the same name as parameter in ADD_PARAMETER
    statement (in this code - "Q_1"), and SQL Query Statement in Reports must have
    same number and type of columns as record group, for example:
    SELECT ROWID, 1 deptno, 'x' dname, 'x' loc FROM DUAL
    And - we can't pass a DATA_PARAMETER to a child query in Report Builder.
    Data passing is supported only for master queries.
    Second example:
    Forms transfers to Reports records from "dept" block,
    using non-query record group (populated from Forms "dept" block in a LOOP):
    DECLARE
    rg_id_l RECORDGROUP;
    rg_name_l VARCHAR2 (30) := 'DEPT';
    row_count_l NUMBER;
    rgc_id_l GROUPCOLUMN;
    pl_id_l PARAMLIST;
    pl_name_l VARCHAR2 (30) := 'PARAM_LIST';
    BEGIN
    rg_id_l := FIND_GROUP (rg_name_l);
    IF NOT ID_NULL (rg_id_l) THEN
    DELETE_GROUP (rg_id_l);
    END IF;
    rg_id_l := CREATE_GROUP (rg_name_l);
    rgc_id_l := ADD_GROUP_COLUMN (rg_id_l, 'deptno', NUMBER_COLUMN);
    rgc_id_l := ADD_GROUP_COLUMN (rg_id_l, 'dname', CHAR_COLUMN, 14);
    rgc_id_l := ADD_GROUP_COLUMN (rg_id_l, 'loc', CHAR_COLUMN, 13);
    GO_BLOCK ('dept');
    FIRST_RECORD;
    row_count_l := 0;
    LOOP
    row_count_l := row_count_l + 1;
    ADD_GROUP_ROW (rg_id_l, row_count_l);
    SET_GROUP_NUMBER_CELL (rg_name_l || '.deptno', row_count_l, :dept.deptno);
    SET_GROUP_CHAR_CELL (rg_name_l || '.dname', row_count_l, :dept.dname);
    SET_GROUP_CHAR_CELL (rg_name_l || '.loc', row_count_l, :dept.loc);
    EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
    NEXT_RECORD;
    END LOOP;
    IF row_count_l = 0 THEN
    MESSAGE ('Nothing to print'); PAUSE;
    RETURN;
    END IF;
    pl_id_l := GET_PARAMETER_LIST (pl_name_l);
    IF NOT ID_NULL (pl_id_l) THEN
    DESTROY_PARAMETER_LIST (pl_id_l);
    END IF;
    pl_id_l := CREATE_PARAMETER_LIST (pl_name_l);
    ADD_PARAMETER (pl_id_l, 'Q_1', DATA_PARAMETER, rg_name_l);
    RUN_PRODUCT (REPORTS, 'REC_GROUP_REPORT', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id_l, NULL);
    END;
    This works in Forms 6i. In Forms 9i we must use RUN_REPORT_OBJECT instead of RUN_PRODUCT
    (see Oracle MetaLink document 110495.1 "Passing a Record Group to Reports Using RUN_REPORT_OBJECT").
    Regards,
    Zlatko Sirotic

  • Problem w/ geting a unique set of records. Too many rows returned

    This is a query that is looking at itself for two diff reasons.
    The d pass is to search the records that are not voided and pass lmc is the records that are the voids.
    I have to identify the valid recs to be voided and then mark them accordingly but I am getting repeating values
    SELECT DISTINCT
    d.CHARGE_ID,
    lmc.CHARGE_ID as CHARGE_ID_THAT_VOIDED_ME ,
    ROW_NUMBER() OVER (PARTITION BY d.charge_id ORDER BY LMC.SOURCE_SYSTEM_RECORD_ID DESC ) AS rown
    FROM CHARGES d
    INNER JOIN CHARGES lmc
    ON d.Encounter_id = LMC.ENCOUNTER_ID
    WHERE d.TRANSACTION_TYPE_CODE = 0 --not voided
    AND lmc.transaction_type_code = 1 --void records that have limited values to tell me what to void
    AND d.SOURCE_SYSTEM = 'MM' --this is my source system
    AND ( d.IMPUTED_SB_MAP + lmc.IMPUTED_SB_MAP) = 0 --sadly one of those values is the dollar amt. Problem occurs when there are two voids of the same value
    CHARGE_ID CHARGE_ID_THAT_VOIDED_ME ROWN
    10138466 10138459 1
    10138467 10138460 1
    10138468 10138462 1
    10138468 10138461 2
    10138469 10138462 1
    10138469 10138461 2
    10138470 10138463 1
    As you can see I will not get a proper set of values to record the Charge Id that voided me for the charge Id to be voided.
    I am having a real issue with this one.
    Please help

    So many looked and were not able to help.By all mean I hold nothing against anyone. Thankfully I never give up and this is what we did:
    1. A table called CHARGES_N_VOID_STG was created
    2. in the declaration section of my procedure:
    cursor c_voids is select * from CHARGES_N_VOIDS_STG;
    Then after the BEGIN:
              If there were any voids in these clean charges, then you must set the valid
              record that it is offsetting to a transaction type code of 2
    EXECUTE IMMEDIATE 'TRUNCATE table CHARGES_N_VOIDS_STG';
    --Insert the voids that have not been processed.
    --If the CHARGE_ID_I_VOIDED is null then it has not been processed                
    INSERT INTO CHARGES_N_VOIDS_STG
    (     CHARGE_ID_Void,
    IMPUTED_SB_MAP_Void,
    BATCH_ID_Void,
    RECORD_SEQ_Void,
    ENCOUNTER_ID_Void,
    SERVICE_CODE_VOID)
    SELECT     DISTINCT
    v.CHARGE_ID,
    v.IMPUTED_SB_MAP,
    v.BATCH_ID,
    v.RECORD_SEQ,
    v.ENCOUNTER_ID,
    V.SERVICE_CODE
    FROM      CHARGES v
    WHERE     v.TRANSACTION_TYPE_CODE = 1
    AND          v.SOURCE_SYSTEM = 'MM'
    AND           v.CHARGE_ID_I_VOIDED IS NULL;
    --For each void record in the temp table..
    FOR r_void IN c_voids LOOP
    --Update the stage table records with a valid charge to be voided          
    UPDATE      CHARGES_N_VOIDS_STG
    SET          CHARGE_ID_Valid =
    (     SELECT      MAX(CHARGE_ID) AS CHARGE_ID
    FROM          CHARGESDS.CHARGES
    WHERE     ENCOUNTER_ID = r_void.ENCOUNTER_ID_Void
    AND          CHARGE_ID_THAT_VOIDED_ME IS NULL
    AND          (IMPUTED_SB_MAP + r_void.IMPUTED_SB_MAP_Void) = 0
    AND          SERVICE_CODE = r_void.SERVICE_CODE_VOID)
    WHERE     BATCH_ID_VOID = r_void.BATCH_ID_Void
    AND          RECORD_SEQ_VOID = r_void.RECORD_SEQ_Void     
    AND           ENCOUNTER_ID_Void IN
    (     SELECT      ENCOUNTER_ID
    FROM          CHARGESDS.CHARGES
    WHERE     ENCOUNTER_ID = r_void.ENCOUNTER_ID_Void
    AND          CHARGE_ID_THAT_VOIDED_ME IS NULL
    AND          (IMPUTED_SB_MAP + r_void.IMPUTED_SB_MAP_Void) = 0);
    --Update a charge with the record's charge ID that voided it and change the trans type code
    -- to 2 and last mod and last modify process id
    UPDATE      CHARGES
    SET          CHARGE_ID_THAT_VOIDED_ME = r_void.CHARGE_ID_VOID,
    TRANSACTION_TYPE_CODE = '2',
    LAST_MODIFIED = sysdate,
    LAST_MODIFY_PROCESS_ID = pCHGDS_PROCESS_ID
    WHERE      CHARGE_ID IN
    (     SELECT      MAX(CHARGE_ID) AS CHARGE_ID
    FROM          CHARGESDS.CHARGES
    WHERE     ENCOUNTER_ID = r_void.ENCOUNTER_ID_Void
    AND          CHARGE_ID_THAT_VOIDED_ME IS NULL
    AND          (IMPUTED_SB_MAP + r_void.IMPUTED_SB_MAP_Void) = 0
    AND          SERVICE_CODE = r_void.SERVICE_CODE_VOID);
    END LOOP; ----For each void in the temp table..
    --Update the voids in Charges with a value that indicates the void has been processed
    UPDATE      CHARGES
    SET          CHARGE_ID_I_VOIDED = (
    SELECT     CHARGE_ID_Valid
    FROM          CHARGES_N_VOIDS_STG
    WHERE     CHARGES.CHARGE_ID = CHARGE_ID_Void)
    WHERE     EXISTS (
    SELECT     CHARGE_ID_Valid
    FROM          CHARGES_N_VOIDS_STG
    WHERE     CHARGES.CHARGE_ID = CHARGE_ID_Void);
    We had no choice but to find the voids first then go through each and find only one records to void that matched our criteria. Some of you may have thought that the client should have put more data to make it easier to find each record but some clients are what they are and you have to make the best of it.
    Thanks and You are welcome
    NAMASTE

  • L9 - all tracks seem to "software monitor" when set to record! BUG?!

    Hi Guys,
    Not sure if this is another Logic 9 bug or if I am just going crazy!
    Often when recording tracking parts, I need to record three or four tracks at the same time. For example, today I was recording vocals, keyboard and bass.
    I always monitor the vocals through Logic, so the singer has some reverb in real time. However, for zero latency monitoring on piano and bass, I would usually just monitor them straight through the mixer and not through Logic.
    To achieve this in Logic 8, I would press the "software monitoring" button (the green one beside the transport window). I'd also press the orange "Low latency mode" button to make sure the tracks that were software monitored would not have any latency.
    Then I would select record for all tracks I was recording, and I would press the "i" button (orange button for input monitoring) for the tracks that I actually wanted to software monitor. Tracks with "i" pressed (usually just vocals) would monitor through Logic with effects, the rest would just be monitored through the mixer.
    In Logic 9, this isn't working! Even if I only press the "i" button on one track, ALL of the tracks are coming through Logic. It seems to be applying software monitoring to ANY TRACK THAT IS IN RECORD MODE, even if the input button isn't pressed for that track!
    So I either have to have ALL record-enabled tracks software monitored (which induces a little bit of latency for the keys and bass) or NONE (and leave the vocalist without any real-time effects in the mix while he sings).
    Am I missing something here? Is there a new setting somewhere that automatically sets all record-enabled tracks to software monitor mode when the software monitoring button is pressed in the transport bar?
    OR... is this a new bug?! It's a big one if it is!
    I'd love to hear what other people think... or if anyone has a suggestion that might help with this? I might just be missing something obvious here, but I don't think so...
    Thanks heaps guys!
    Mike

    yeloop wrote:
    Hi Guys,
    Not sure if this is another Logic 9 bug or if I am just going crazy!
    Often when recording tracking parts, I need to record three or four tracks at the same time. For example, today I was recording vocals, keyboard and bass.
    I always monitor the vocals through Logic, so the singer has some reverb in real time. However, for zero latency monitoring on piano and bass, I would usually just monitor them straight through the mixer and not through Logic.
    To achieve this in Logic 8, I would press the "software monitoring" button (the green one beside the transport window). I'd also press the orange "Low latency mode" button to make sure the tracks that were software monitored would not have any latency.
    That's not what Low Latency Mode does, it only bypasses high latency inducing plugins, there's a threshold setting in Logic. But that's not the problem...
    Then I would select record for all tracks I was recording, and I would press the "i" button (orange button for input monitoring) for the tracks that I actually wanted to software monitor. Tracks with "i" pressed (usually just vocals) would monitor through Logic with effects, the rest would just be monitored through the mixer.
    That's not how it works here (on version 8.02)
    With software monitoring enabled any track in record mode is passed through Logic's audio engine. Input monitoring only works when a track is -not- record enabled. At least that's how it's working with my RME hardware.
    Perhaps you're thinking of "Auto Input Monitoring", try adding that button to the transport bar and see if that's working the way you expect. Any tracks set to input monitoring and record will pass their signal thru Logic, tracks set to record only, will not. The sequencer has to be running so the vocalist wouldn't hear reverb until you actually start recording.
    pancenter-

  • Same set of Records not in the same Data package of the extractor

    Hi All,
    I have got one senario. While extracting the records from the ECC based on some condition I want to add some more records in to ECC. To be more clear based on some condition I want to add addiional lines of data by gving APPEND C_T_DATA.
    For eg.
    I have  a set of records with same company code, same contract same delivery leg and different pricing leg.
    If delivery leg and pricing leg is 1 then I want to add one line of record.
    There will be several records with the same company code contract delivery leg and pricing leg. In the extraction logic I will extract with the following command i_t_data [] = c_t_data [], then sort with company code, contract delivery and pricing leg. then Delete duplicate with adjustcent..command...to get one record, based on this record with some condition I will populate a new line of record what my business neeeds.
    My concern is
    if the same set of records over shoot the datapackage size how to handle this. Is there any option.
    My data package size is 50,000. Suppose I get a same set of records ie same company code, contract delivery leg and pricing leg as 49999 th record. Suppose there are 10 records with the same characteristics the extraction will hapen in 2 data packages then delete dplicate and the above logic will get wrong. How I can handle this secnaio. Whether Delta enabled function module help me to tackle this. I want to do it only in Extraction. as Data source enhancement.
    Anil.
    Edited by: Anil on Aug 29, 2010 5:56 AM

    Hi,
    You will have to do the enhancement of the data source.
    Please follow the below link.
    You can write your logic to add the additional records in the case statement for your data source.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c035c402-3d1a-2d10-4380-af8f26b5026f?quicklink=index&overridelayout=true
    Hope this will solve your issue.

  • How to devide the set of records into groups in SQL itself.

    Hi , i am using 10.2.4.0 of oracle.
    I am having one requirement, in which i have to devide the set of records into certain groups , so that they can be executed partly but not in one run.
    So in the 'SELECT' clause itself i want to asssign particular value (may be 1 )to first 50000 records then another value(may be 2) to next 10000, like wise. And again the total count of records will also varry time to time , if the total count of record set is less than 10000 , then it should only assign '1' to all the records. i will set the group values (1,2,3...) as another column itself.
    Can you please let me know if this can be done in SQL without going for PLSQL?

    Hi,
    That's called a Pagination Query , and here's one way to do it:
    WITH     got_grp          AS
         SELECT     x.*
         ,     CEIL ( ROW_NUMBER () OVER (ORDER BY  x_id) 
                   / 50000
                   )          AS grp
         FROM     table_x  x
    --     WHERE     ...          -- If you need any filtering, put it here
    SELECT     *               -- Or list the columns you want
    FROM     got_grp
    WHERE     grp     = 1
    ;ROW_NUMBER () OVER (ORDER BY x_id)     assigns unique integers 1, 2, 3, ... to all all rows, in the same order as x_id (even if x_id is not unique).
    CEIL (ROW_NUMBER () OVER (ORDER BY x_id) / 50000)     maps the 1st 50,000 of those numbers to 1, the 2nd 50,000 to 2, and so on.
    Analytic functions (like ROW_NUMBER) as computed after the WHERE clause is applied, so, to use the results in a WHERE clause, then you need to compute them in a sub-query. If you just want to display the number, and not use it in a WHERE clause, then you don't need a sub-query.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • How to post a table/set of records without losing formatting while posting

    how to post a table/set of records without losing formatting while posting in this message forum. Thanks

    Most forums have a FAQ. This one is no exception.
    It is in the right hand upper corner. It's URL is http://wikis.sun.com/display/Forums/Forums+FAQ
    Sybrand Bakker
    Senior Oracle DBA

  • How does jdbc fetch a set of records in oracle

    Hi,
    Oracle does not support server side cursors,if so how does jdbc fetch a set of records(set by setFetchSize(), which is 10 by default) each time I say rs.next().Does this mean Query is re-executed to fetch the next set of records? Can some body throw some light on this?
    thanx in advance
    Gnayan

    You are asking about implementation details of some JDBC driver, but you don't say which one. This makes it very difficult to answer your question. You might want to try asking the question of the people who wrote the driver.

  • Set maximum record time?

    Can I set maximum record time in Logic 8? Recording an hour-long live program unsupervised, & I'd like it to stop afterwards.
    (I don't know any problem with continuing recording for hours until the hard drive is full? But it's not necessary.)
    thanks

    You can use the Auto-Punch In/Out function to set Logic stop recording automatically.
    Also, set the bar value for the project end (at the transportbar, under the tempo).
    For How long you can record depends on you HD capacity, but also the file format (aif,wav,caf...) the bit depth and the sample rate.
    each format has its own limit.
    Refer to user manual and check for the best file format for your purpose.

  • Problems setting the recording path

    I have recorded hundreds of songs successfully by setting the recording path to the project folders on my external hard drive. Now whenever I open a new project and go to record an audio file it ask me every time to set the recording path. I pick the location on my external, click save and then hit the record button and then the whole process starts all over.

    does your drive has a Sleep mode (or something like that) preference?that's after a certain time of inactivity...goes to sleep
    Might be that..
    A

  • ESB Process reads a Batch file for a limited set of records only..?

    Dear All,
    I am having an ESB process that reads a Batch file (csv) that has around 10,000 Products information.
    I have another BPEL process that will create the Product in Oracle Apps through standard API (Main BPEL process that calls a child process for creating product).
    I am invoking the BPEL process from ESB, and that works fine.
    Now, the Issue is: I am able to create at a time around 10 Products (the main process calls the child process in a loop.). The main process instance is not getting created but the child process instance is getting created for a set of records, afterwards the child process instances get stops creating. The main process instance could not be found in the console. Not getting why the process is not getting visible as well it is not completing the process.
    What could be the problem for this... Am I need to change any environment configurations...?
    Please update...
    Many Thanks in advance...

    Does this apply to you?
    https://social.technet.microsoft.com/Forums/en-US/9ccd8e50-b0af-4f58-9787-6435834e4c52/dfsr-not-working-on-new-windows-2008r2-server
    Thanks for the link, but no - not the same scenario although the error is the same.   The RGs I'm working with are all in sync and communication is working, it's just getting the backlog reported correctly.
    To reiterate, I can paste two versions of the exact command into the DOS window buffer; one copied from OneNote and one copied from my batch file.  Executing the one from OneNote succeeds and reports the RG in sync and the one copied from the batch
    file fails.
    I can repeat the results by up arrow once to the command pasted into the buffer from the batch file and see it fail.  Then up arrow twice to retrieve the command pasted from OneNote into the buffer and it will report correctly (illustrated in the grahic).
    Let me add that the command in the batch file was originally copied from OneNote and pasted in to the batch file; as if going into the batch file somehow corrupts it.
    - a -

  • How to retain current set of records in advanced table in OAF

    I have an advanced table in a OAF page. Number of records displayed is set to 5. Now, when I have more than 5 records, we can view the next set of records using navigation buttons of the advanced table. One of its column is an image which has "Action Type" as "fireAction" and "Submit" set to "True", which when clicked displays further details about the selected record in a separate region. However, in this process the page is getting refreshed and the table is again displaying the first set of 5 records even if i chose to display details about record in the next set of 5 (i.e after navigating using "Next 5" button of the table).
    Is there any way to retain the current set of records displayed in the advanced table across the page refresh.?
    Thanks
    Nagamanoj

    Solved.
    Somewhere in our code, while populating one of the columns of the table, we were resetting the VO which was causing the issue. Modified that method call to add a parameter to mention from which row should the table be populated.
    Thanks
    Nagamanoj

  • How Do I set the "Record" settings in Sound booth.

    How Do I set the "Record" bit settings in Sound Booth, i.e. the 16 bit rate so that the wav files will burn to a music CD. (the default 48 will dot burn to a CD).
    Thanks Marv.

    Why not post in the SB forum?
    Go to File/Record and set the format to what you need:

  • How to post a set of records

    i want to post a set of records and get it
    say some 5 records of size 6 fields.
    how to post these values and get it to insert into database
    it is like transaction entries
    pls help

    Can you be more specific.
    One of the solutions : In your HTML form you define alll the records you want to post to another page and give them names somethiong like this:
    <form>
    <input type="text" name="record()" value="" />
    <input type="text" name="record()" value="" />
    <input type="text" name="record()" value="" />
    <input type="text" name="record()" value="" />
    <input type="text" name="record()" value="" />
    </form>
    Now let say that you did this and you submited your form. What you get on target script is PHP array called $record. this areay consists of 5 elements (from 0 to 4). element 0 coresponds to first input in yout HTML form. Element 4 coresponds to your last input in your HTML form.
    You can always traverse through $_POST variable and see what is comming to the page through post.
    Is this the answert to your question?
    skodman

  • Displaying a set of records using jstl

    hi i am new to jstl.my requirement is i want to display a set of records from my database using jstl.for eg i want to display 50 records per page and i want to navigate to other records using next and prevoius buttons and i need to put view and edit buttons in that page.can anybody give me a solution for this.urgent

    You may try the paging taglib ...
    http://www.servletsuite.com/servlets/pagertag.htm

Maybe you are looking for