How to retrive one table records into another table by multiple records

how to retrive table X records into another table Y by multiple records (means at once i want display 10 records) in form 6i .
when i am written cursor it is ftching only one record.But i want to display all records at once.
Declare
Cursor cur_name is
select PROTOCOL_NO,DOCNUM,SUBSETSN,REPEATSN,AESEQ,AETERM from coding_ae WHERE PROTOCOL_NO='KP229';
Begin
open cur_name;
loop
fetch cur_name into :PROTOCOL_NO,:DOCNUM,:SUBSETSN,:REPEATSN,:AESEQ,:AETERM;
exit when cur_name%notfound;
next_record;
end loop;
close cur_name;
End;

Hi,
Make sure the cursor is in the detailed block. For that use 8GO_BLOCK* built-in. So the code will be
Declare
Cursor cur_name is
select PROTOCOL_NO,DOCNUM,SUBSETSN,REPEATSN,AESEQ,AETERM from coding_ae;
Begin
GO_BLOCK('<detailed_block_name>');
open cur_name;
loop
fetch cur_name into :PROTOCOL_NO,:DOCNUM,:SUBSETSN,:REPEATSN,:AESEQ,:AETERM;
exit when cur_name%notfound;
next_record;
end loop;
close cur_name;
End;Regards,
Manu.
If my response or the response of another was helpful or Correct, please mark it accordingly

Similar Messages

  • Copy selected values from a table control into another table control

    hi there,
    as seen in the subject i need to copy selected values from a table control into another table control in the same screen. as i dont know much about table controls i made 2 table controls with the wizard and started to change the code... right now im totally messed up. nothing works anymore and i don't know where to start over.
    i looked up the forums and google, but there is nothing to help me with this problem (or i suck in searching the internet for solutions)
    i have 2 buttons. one to push the selected data from the top table control into the bottom tc and the other button is to push selected data from the bottom tc into the top tc. does somebody has a sample code to do this?

    you're funny
    i still don't get it... can't believe, there is no tutorial or sample code around how to copy multiple selected rows from a tc.
    here's my code, maybe you can tell me exactly were i have to change it:
    tc1 = upper table control
    tc2 = lower table control
    SCREEN 0100:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      MODULE get_nfo. --> gets data from the dictionary table
      MODULE tc1_change_tc_attr.
      LOOP AT   it_roles_tc1
           INTO wa_roles_tc1
           WITH CONTROL tc1
           CURSOR tc1-current_line.
      ENDLOOP.
      MODULE tc2_change_tc_attr.
      LOOP AT   it_roles_tc2
           INTO wa_roles_tc2l
           WITH CONTROL tc2
           CURSOR tc2-current_line.
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP AT it_roles_tc1.
        CHAIN.
          FIELD wa_roles_tc1-agr_name.
          FIELD wa_roles_tc1-text.
        ENDCHAIN.
        FIELD wa_roles_tc1-mark
          MODULE tc1_mark ON REQUEST.
      ENDLOOP.
      LOOP AT it_roles_tc2.
        CHAIN.
          FIELD wa_roles_tc2-agr_name.
          FIELD wa_roles_tc2-text.
        ENDCHAIN.
        FIELD wa_roles_tc2-mark
          MODULE tc2_mark ON REQUEST.
      ENDLOOP.
      MODULE ok_code.
      MODULE user_command_0100.
    INCLUDE PAI:
    MODULE tc1_mark INPUT.
      IF tc1-line_sel_mode = 2
      AND wa_roles_tc1-mark = 'X'.
        LOOP AT it_roles_tc1 INTO g_tc1_wa2
          WHERE mark = 'X'.    -
    > big problem here is, that no entry has an 'X' there
          g_tc1_wa2-mark = ''.
          MODIFY it_roles_tc1
            FROM g_tc1_wa2
            TRANSPORTING mark.
        ENDLOOP.
      ENDIF.
      MODIFY it_roles_tc1
        FROM wa_roles_tc1
        INDEX tc1-current_line
        TRANSPORTING mark.
    ENDMODULE.                    "TC1_MARK INPUT
    MODULE tc2_mark INPUT.
      IF tc2-line_sel_mode = 2
      AND wa_roles_tc2-mark = 'X'.
        LOOP AT it_roles_tc2 INTO g_tc2_wa2
          WHERE mark = 'X'.             -
    > same here, it doesn't gets any data
          g_tc2_wa2-mark = ''.
          MODIFY it_roles_tc2
            FROM g_tc2_wa2
            TRANSPORTING mark.
        ENDLOOP.
      ENDIF.
      MODIFY it_roles_tc2
        FROM wa_roles_tc2
        INDEX tc2-current_line
        TRANSPORTING mark.
    ENDMODULE. 
    thx for anybody who can help with this!

  • How can I [cmd]+A including text boxes? Or how to import one Pages document into another Pages document?

    Hi there,
    I am working on my thesis with several Pages documents (for the first time). And I really have searched all over the Internet to find an answer to exactly my question but I cannot find it.
    First my question was: How can I import one Pages document into another one? I found the answer on that (I think) and there is nothing else than just make a new section and copy/paste it in.
    But then another issue pops up: I cannot [cmd]+A my whole document including the texboxes to paste it in the other Pages document. Then the document will be paste without the textboxes (and I have quite a lot of them in that document) and the text will not be at the right place.
    So please explain to me: How I can combine two Pages documents and keep them exactly the way they are? Is that even possible?
    I thank you so much in advance!

    Hi Fruhulda,
    I have already tried to mark the textboxes in line but that did not work, and besides then the text and the boxes won't be at the rigt places either. Thank you for your reply .

  • Insert Records into another tables

    Hi guyz,
    I have four tables as below
    1) employee
    empid (primary key)
    deptid
    emp_name
    work_location
    date_of_join
    emp_status
    date
    2) Termination
    empid reference employee
    deptid
    emp_name
    work_location
    terminate_date
    3) Resignation
    empid reference employee
    deptid
    emp_name
    work_location
    resign_date
    4) Vacation
    empid reference employee
    deptid
    emp_name
    work_location
    vac_date
    i have list item on employee form --> emp_status is list item whic contain Termination, Resignation, Vacation
    i want to update employee as well other tables if user select the respected field from the list item.
    if the user select termination/resignation from the list item the date item will be enable and user should enter the date,otherwise give the error on commit please enter the date and when user commit the record on employee it should update the table employee and delete the record belongs to Termination/Reisgnation and the record will be insert into Termination/Resignation table as select by user from list item.i tried this before but im fail i write the below code on pre-update trigger as below
    begin
    insert into termination
    (empid,deptid,emp_name,work_location,termination_date)select (empid,deptid,emp_name,work_location,date from employee where emp_status='Termination';
    delete from employee where emp_status='Termination' ;
    end;
    same as on resignation
    anybuddy help me how to do this task? to update the tables. im new in oracle.
    Regards
    Edited by: user10648713 on Dec 21, 2008 4:29 AM

    You run into the classic Mutating table problem. You cannot issue DML-statement against the same table the trigger is based on in a FOR EACH ROW-trigger.
    But even worse, you will cause any kind of client program to get in trouble if you implement such a logic. The client issues an update and as a result the record gets deleted. And, for you have a forms-module based i tell you that you will get problems with your forms-module.
    I still can't see whats the sense behind it, putting records into different tables dependant on a status. Oracle is built to manage large data volumes, so even for a large number of records that doesn't make sense to me.
    But anyway if you still want to deal with that multi-table-approach, go for the following:
    You will need three triggers on your table: a before-statement, an after-statement and a for-each-row-trigger:
    The before-statement will initialize a list of PK-Items
    The for-each-row will add the id of the processed row to the list
    The after-statement will loop over the list and process the rows.
    Create a Package for handling the logic including three procedures
    CREATE OR REPLACE PACKAGE PK_TRIGGER IS
      PROCEDURE PR_BS;
      PROCEDURE PR_ARIU(i_nEmpId IN NUMBER);
      PROCEDURE PR_AS;
    END;
    CREATE OR REPLACE PACKAGE BODY IS
      TYPE tData IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      lData tData;
      PROCEDURE PR_BS IS
      BEGIN
        lData.DELETE;
      END;
      PROCEDURE PR_ARIU(i_nEmpId IN NUMBER) IS
        iPos PLS_INTEGER:=lData.COUNT+1;
      BEGIN
        lData(iPos):=i_nEmpId;
      END;
      PROCEDURE PR_AS IS
        CURSOR crEmp(i_nEmpId IN NUMBER) IS
          SELECT *
            FROM EMP
           WHERE EMP_ID=i_nEmpId;
        recEmp crEmp%ROWTYPE;
        iPos PLS_INTEGER;
      BEGIN
        iPos:=lData.FIRST;
        LOOP
          EXIT WHEN iPos IS NULL;
          -- Do whatever you want with the data in the record
          OPEN crEmp(lData(iPos));
          FETCH crEmp INTO recEmp;
          IF crEmp%FOUND THEN
            IF :NEW.EMP_STATUS='Termination' THEN
              DELETE FROM emp
               WHERE EMPID=lData(iPos);
              INSERT INTO TERMINATION (
                empid,
                deptid,
                emp_name,
                work_location,
                t_date
              ) VALUES (
                recEmp.empid,
                recEmp.deptid,
                recEmp.emp_name,
                recEmp.work_location,
                sysdate
            END IF;
          END IF; 
          CLOSE crEmp;
          -- Process next record
          iPos:=lIds.NEXT(iPos);
        END LOOP;
        lIds.DELETE;
      END;
    END;Now create the three triggers calling the appropiate procedures.

  • How to insert apex_application_files file content into another table?

    Hi All,
    I am using Apex 3.2 on Oracle 10g.
    I have used 'file_browse' item to upload a spreadsheet file into apex_application_files table.
    I would like to populate another table with the contents of this spreadsheet file from apex_application_files.
    I have spent almost 2 days looking for an answer on how to do this.
    Can you please tell me how to do this or point me to a good resource?
    Thank you,
    Naushad.

    Hi Thanks,
    I did see this code, but this is not what I was looking for. This code simply inserts the file into another table, but I was looking for the contents of this file (eg. a single column spreadsheet with 10 lines and all ten of these lines to be inserted as rows in a table) inserted as rows into another table.
    I managed to implement this by following below link:
    http://nzchaudhry.wordpress.com/2011/07/18/uploading-csv-using-oracle-application-express-apex/
    Thanks to all of you.
    Naushad.

  • How to move milion of records into another table

    Hello, I would like to know if there is some way how to move large number of rows from one table into another.
    We have several tables storing runtime data. Data older then e.g. 10 days are moved into hitory tables. Currently we do this via pl/sql, but I was wondering if it is possible to do this somehow in SQL only (to make it faster).
    It is not possible to simply rename the tables, we need to move the data.
    Thanks for ideas.

    872553 wrote:
    Hello, I would like to know if there is some way how to move large number of rows from one table into another.
    We have several tables storing runtime data. Data older then e.g. 10 days are moved into hitory tables. Currently we do this via pl/sql, but I was wondering if it is possible to do this somehow in SQL only (to make it faster).
    It is not possible to simply rename the tables, we need to move the data.
    Thanks for ideas.To me looks like a Regular scheduled activity.
    Hence, using DBMS_SCHEDULER should be helpful.
    Create a Procedure to Copy the records from Transaction Table to History Table.
    create or replace procedure copyTransactionToHistory
    is
    begin
      insert /*+ append */ into history_table
      select column_list
        from transaction_table
       where transaction_date = trunc(sysdate) - 10;
      commit;
    end;
    Use DBMS_SCHEDULER to create Job with specified Time Interval (10 Days in your situation). More information and Examples are provided <a href="http://docs.oracle.com/cd/B28359_01/server.111/b28310/schedadmin006.htm#i1009099">Here</a>.There is also a possibilty of using NOLOGGING, but that will be recommended if the activity is not a regular scheduled activity and I do not think it would be a wise option to change the Table mode from LOGGING to NOLOGGING and vice-versa frequently.
    You might also consider options to improve the Data movement.
    1. Disabling Indexes/Constraints, if any, on History table.
    2. Using PARALLEL DML's option
    However, important information viz. your Oracle Version (Output of SELECT * FROM V$VERSION), Number of Records etc. are not mentioned which leaves us with no choice but to assume and suggest what we feel is best.
    Please read and post the information accordingly for us to help you. {message:id=9360002}

  • How to import one project file into another project file

    In previous versions I could take an 8 track project file and drag it into another project.  This doesn't work in version 10.  I am playing multi track stems for worship.  I create each song as it's own file then drag them together to create a set.  I don't mix down since I want to be able to add or subtract an instrument based on who may or may not be avaiable that day.  Has this feature been taken out of Version 10?  Can you do this in either Logic or Mainstage?
    Thanks

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <xsl:variable name="xml1" select="document('xml1.xml')"/>
    <xsl:variable name="xml2" select="document('xml2.xml')"/>
    <xsl:copy-of select="$xml1"/>
    <xsl:copy-of select="$xml2"/>
    </xsl:template>
    </xsl:stylesheet>

  • How to add one textbox value into another textbox value every month in a list of infopath 2013

    InfoPath 2013.
    I have created a list in which I placed 2 textboxes.
    I have one textbox named Paid Amount:
    Second textbox named Invoice Amount:
    I want when I add any amount in Invoice Amount textbox in every month it Add into
    Paid Amount textbox
    How I can do this ?
    for e.g:
    Paid Amount : 2
    Invoice Amount: 3
    Paid Amount = 5
    When enter next month 6 in Invoice Amount the
    Paid Amount turn into 11.

    You can apply formula using a rule by creating a hidden field and calculate the values. Refer to the following posts for more information
    http://office.microsoft.com/en-in/infopath-help/add-subtract-multiply-and-divide-values-HP001096532.aspx
    https://support.office.com/en-us/article/Add-rules-for-performing-other-actions-5322d726-b787-4e5f-8d37-ba6db68b451d?ui=en-US&rs=en-US&ad=US
    and for complex calculations using code, refer to the following posts
    http://www.infopathdev.com/forums/p/21500/74297.aspx
    http://drekendrop.blogspot.in/2011/03/infopath-2010-get-and-set-value-of.html
    Cheers,

  • JDBC sender: after read insert records into another table

    Hi all,
    I send records from a SQL view (not a table) to RFC via proxy method.
    After reading a record from the view I would like to move this record to a database table called CHECKED. Can anyone provide me a solution for this or is this impossible. (there are 6 fields that have to be inserted in DB CHECKED after reading: admin, bukrs, dagbknr, bkstnr, datum, regel)
    Can I use an INSERT statement in my Update SQL Statement with variables or do I have to create an SP?
    Hope someone can help me out of here...
    Thanks in advance!
    Wouter.

    ur strucutre would of:
    <root>
    <Satement1>
    <TableName action=”INSERT”>
    <table>checked</table>
    <access>
    <admin>val</admin>
    <bukrs>val</bukrs>
    <dagbknr>val</dagbknr>
    <bkstnr>val</bkstnr>
    <datum>val</datum>
    <regel>val</regel>
    </access>
    </dbTableName>
    </StatementName1>
    </root>
    or u can use a SQL DML which wud pose a strucutre similar to
    <root>
      <stmt>
        <Customers action="SQL_DML">
          <access> INSERT CHECKED SET admin=’$admin$’, bukrs=’$bukrs$', dagbknr=’$dagbknr$’, bkstnr=’$bkstnr$', datum=’$datum$’, regel.=’$regel.$'
          </access>
        </Customers>
      </stmt>
    </root>
    for more inputs refer to <a href="/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 link on jdbc</a>

  • How to include one xml file into another

    Dear Sir/Madam!
    Could you do me a favour and help me to solve the problem like this:
    I have one xml file wich describe the common thins of the GUI, and the another will be generated depending on the point the user has selected.
    I would be very pleased for any helpful assistance.

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <xsl:variable name="xml1" select="document('xml1.xml')"/>
    <xsl:variable name="xml2" select="document('xml2.xml')"/>
    <xsl:copy-of select="$xml1"/>
    <xsl:copy-of select="$xml2"/>
    </xsl:template>
    </xsl:stylesheet>

  • How to copy one account preferences into another account on the same mac?

    I would like to open a new account (on the same mac) but would like to copy some preferences including software from the existing account. How can I do that?
    Thanks

    To copy files from Account A to Account B:
    1. Log in as A.
    2. Find the files you wish to copy.
    3. Move them to /Users/A/Public. Don't move your actual Documents, Pictures, Library etc folders. Just move their contents.
    4. Log in as B.
    5. Navigate with Finder to /Users/A/Public.
    6. Drag the files to the desktop to make new copies of them.
    7. Put the files away in the appropriate places in B's home folder.
    8. Log back in as A and move the files in /Users/A/Public back to their original locations.

  • How to insert one XML document into another

    Hi,
    I've been working on a simple CMS.
    There is a main template that is just a HTML page. The main template has a few extra 'module' tags that indicates places where individual modules have to be placed.
    main template: template.xml
    <html>
    <body>
    <div>
    <module id="centre"/>
    </div>
    </body>
    </html>module template: module_centre.xml
    <div>
    <a>This is a MODULE and it may be much more complex</a>
    <div>My application has to detect every 'module' tag from the template.xml and insert there XML content from a proper module template.
    The result file has to be generated dynamically on a request. The structures of 'modules' can be only defined in module_*.xml files.
    The expected result
    <html>
      <body>
        <div>
            <div>
                <a>This is a MODULE and it may be much more complex</a>
            <div>
        </div>
      </body>
    </html>What's the best practice do solve this case?
    Pawel

    I think I've came up with a better solution.
    SRC file
    <?xml version="1.0" encoding="utf-8"?>
    <html>
      <head>
        <title></title>
        <style type="text/css">
    div.c4 {background-color:pink;width:400px;height:50px}
    div.c3 {background-color:green}
    div.c2 {background-color:blue;width:400px;height:299px}
    div.c1 {background-color:red}
    </style>
      </head>
      <body>
      <module id="XXX"/>
        <div id="main" class="c3">
          <div id="top" class="c1"><module id="menu_test"/></div>
          <div id="bottom" class="c2"><module id="menu_test2"/></div>
        </div>
        <div id="footer_container" class="c4">    <module id="menu_footer"/></div>
      </body>
    </html>MODULE src file
    <?xml version="1.0" encoding="UTF-8"?>
    <div id="admin_panel_module" style="background-color:orange;width:200px;height:50px">
        <p>Control Panel TEST</p>
    </div> @param source  -  NODES from MODULE document
    *@param target - TEMPLATE document where MODULES are going to be inserted*
    @throws Exception
    public static void insertModules(Node source, Document target) throws Exception {
    Node importedNodes = target.importNode(source, true);
    // Use XPath to find all 'module' nodes in ''
    XPath xpath = XPathFactory.newInstance().newXPath();
    NodeList nodes = (NodeList) xpath.evaluate("//module", target, XPathConstants.NODESET);
    // Remove MODULE node and insert there an XML content from MODULE template
    for (int idx = 0; idx < nodes.getLength(); idx++) {
    Node editedModuleElement = nodes.item(idx);
    // parent of module mode
    Node parentNode = editedModuleElement.getParentNode();
    // replace <module/> node with imported nodes from 'module' XML document
    parentNode.replaceChild(importedNodes, editedModuleElement);
    // nodes.item(idx).appendChild(node);
    importedNodes = target.importNode(source, true);
    }Edited by: maestr0 on May 24, 2010 12:44 AM

  • Is it possible to import existing tables dump into another tables.

    Hi,
    i have a schema called "xyz". in that i have a,b,c tables. i took a,b,c tables backup using normal export. and also i have e,f,g tables in same schema ("xyz"). i want to import a,b,c data into e,f,g tables. can anyone please let me know what is the import command. dont give me the data pump options. i have some problems to take the data pump expors of those 3 tables.

    841731 wrote:
    Hi,
    i have a schema called "xyz". in that i have a,b,c tables. i took a,b,c tables backup using normal export. and also i have e,f,g tables in same schema ("xyz"). i want to import a,b,c data into e,f,g tables. can anyone please let me know what is the import command. dont give me the data pump options. i have some problems to take the data pump expors of those 3 tables.not possible using exp & imp

  • How to get the data from one table and insert into another table

    Hi,
    We have requirement to build OA page with the data needs to be populated from one table and on save data into another table.
    For the above requirement what the best way to implement in OAF.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    Thanks

    You can achieve this in many different ways, one is
    1. Create another VO based on the EO which is based on the dest table.
    2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
    3. commiting the transaction will push the data into the dest table on which the dest VO is based.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
    Tapash

  • How can I get a count at the same time I am inserting into another table

    I have a requirement where I have to find out the count(number of records inserted into another table) at the same time I insert into the table:
    Like
    I am copying records from table B to A, while doing this I have to find out how many records I've inserted since I need this count in subsequent steps
    INSERT INTO A
    SELECT * FROM B
    how can I store the count into any variable while doing above statement
    Please advice

    No, Warren that doesn't work!
    SQL> set serveroutput on
    SQL> declare
      2     vCtr  number := 0;
      3  begin
      4     insert into emp2
      5     select * from emp;
      6
      7     select count(*)
      8       into vCtr
      9       from emp2;
    10
    11     dbms_output.put_line('rows created '||to_char(vCtr));
    12  end;
    13  /
    rows created 15
    PL/SQL procedure successfully completed.
    SQL> declare
      2     vCtr  number := 0;
      3  begin
      4     insert into emp2
      5     select * from emp;
      6
      7     select count(*)
      8       into vCtr
      9       from emp2;
    10
    11     dbms_output.put_line('rows created '||to_char(vCtr));
    12  end;
    13  /
    rows created 30
    PL/SQL procedure successfully completed.
    SQL>

Maybe you are looking for

  • WLSE - AP/WDS fails to complete full authentication phase

    I need the patch for the following bug. I can't find it anywhere.. Can someone help.. I know people have used it to fix their issues before. This issue is documented in Cisco bug ID CSCsb47726. There is a pointed patch available for ACS 3.3.3 (both A

  • I-Book battery causing freezes?

    Yesterday my i-book started freezing up completely. I tried everything, and eventually re-enstalled OS X, but it still kept freezing. So on a totally random whim I removed my battery and am running just on wall power. So far it has not frozen up agai

  • What is the area code of basingstoke ( 3 digit)

    What is the area code of basingstoke ( 3 digit)

  • Change log-in image

    Hi experts i'd like to know the way to change the standard SRM-EBP image of the log-in. It is via se80 but i don't remember if i've to search into MIME repository or so on... Can u help me? thanks regards ab

  • Preload looks better before?

    I tried to search keywords, but it turns up nothing... When loading RAW .NEF files: 1. First loads a blurry image preview 2. Then refreshes to a preload image like this: and then 3. loads a final preview like this: My question is...  Is there a way t