How do I add a subset of records to a set of records?

I have a result set of consultants and branch offices and I need to add a subset of employees to each branch office.
I added an Employee[ ] subset to my consultant getter/setters. A PL/SQL package returns a cursor result set
of consultants and branch offices and another cursor result set of employees. Each employee is assigned an
office ID and each consultant and branch office is assigned an office ID.
I am unsure in Java how to traverse the employee result set to get each subset of employees with the correct office.
Here is the code that calls the PL/SQL and loads my vector array with consultants and branch offices:
    public Consultant[] getConsultants(String pvConsultant_Firm,
                                        String pvAddr_City_Main,
                                        String pvAddr_State_Main,
                                        String pvAddr_Zip_Main, 
                                        String pvAddr_City_Branch,
                                        String pvAddr_State_Branch,
                                        String pvAddr_Zip_Branch,
                                        String pvResidency,
                                        String pvFirst_Name,    
                                        String pvLast_Name,
                                        String pvOrder_By_Office,
                                        String pvOrder_By_Employee,
                                        String display_Branch,
                                        String display_Employee)
      Vector retval = new Vector();
      DBConnection conn = new DBConnection();
      CallableStatement cstmt = conn.prepareCall("begin " + PACKAGE + "Get_Consultant_Cursors(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);end;");
      ResultSet rsConsultant;
      ResultSet rsEmployee;
      Consultant curConsult;
      Employee curEmployee;
      try
         if(cstmt!=null)
            String Consult_Type = null;
            if ("true".equalsIgnoreCase(display_Branch) ||
                 "true".equalsIgnoreCase(display_Employee)){
               Consult_Type = null;
            else {
               Consult_Type = "MAIN";
            cstmt.setString("pvConsultant_Firm", pvConsultant_Firm);
            cstmt.setString("pvOffice_Type", Consult_Type);
            cstmt.setString("pvAddr_City_Main", pvAddr_City_Main);
            cstmt.setString("pvAddr_State_Main", pvAddr_State_Main);
            cstmt.setString("pvAddr_Zip_Main", pvAddr_Zip_Main);
            cstmt.setString("pvAddr_City_Branch", pvAddr_City_Branch);
            cstmt.setString("pvAddr_State_Branch", pvAddr_State_Branch);
            cstmt.setString("pvAddr_Zip_Branch", pvAddr_Zip_Branch);
            cstmt.setString("pvResidency", pvResidency);
            cstmt.setString("pvFirst_Name", pvFirst_Name);
            cstmt.setString("pvLast_Name", pvLast_Name);
            cstmt.setString("pvOrder_By_Employee", pvOrder_By_Employee);
            cstmt.setString("pvOrder_By_Office", pvOrder_By_Office);
            cstmt.registerOutParameter("pcurConsultant_Office", OracleTypes.CURSOR);
            cstmt.registerOutParameter("pcurConsultant_Employee", OracleTypes.CURSOR);
            cstmt.execute();
            rsConsultant = (ResultSet)cstmt.getObject("pcurConsultant_Office");
            rsEmployee = (ResultSet)cstmt.getObject("pcurConsultant_Employee");
            while(rsConsultant.next())
                curConsult = getConsultant(rsConsultant);
                retval.add(curConsult);
                 if ("true".equalsIgnoreCase(display_Employee)){
HOW DO I HANDLE THIS?
             rsConsultant.close();
             conn.closeCstmt(cstmt);
          catch (SQLException e)
             conn.logToFile(this, "getConsultants()", e);
          conn.close();
       return (Consultant[])retval.toArray(new Consultant[retval.size()]);
    }

It will basically look something like this:
Consultant A           Main Office
                                             Employee 1
                                             Employee 2
                                             Employee 3
                       Branch A       
                                             Employee 4
                                             Employee 5
                       Branch B
                                             Employee 6
                                             Employee 7
Consultant B           Main Office
                                             Employee 8
                                             Employee 9
                       Branch A       
                                             Employee 10
                                             Employee 11The consultant and branch offices are in one result set and the employees are in another. I need to combine them
so I can return them and display them as above in my JSP.

Similar Messages

  • How to i add an image path with spry data set

    hi
    how to i add an image path with spry data set. I made a xml file and then created a data set in html but image won't load
    this is my XML
    <?xml version="1.0" encoding="UTF-8"?>
    <banner width = "185" height = "400">
        <item>
            <image scr = "nui-panforte-recipe_01.jpg" ></image>
            <description>CHOC-COCONUT PANFORTE</description>      
            <text1>Try this delicious GLUTEN FREE Christmas treat</text1>
            <text2>CHOC-COCONUT PANFORTE</text2>
        </item>
    </banner>
    this is my HTML
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="../../SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="../../SpryAssets/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var ds1 = new Spry.Data.XMLDataSet("recipe_banner.xml", "banner/item");
    //-->
    </script>
    </head>
    <body>
    <div spry:region="ds1">
      <table>
        <tr spry:repeat="ds1">
          <td>{image}</td>
          <td>{description}</td>
          <td>{text1}</td>
          <td>{text2}</td>
          <td>{text3}</td>
          <td>{text4}</td>
          <td>{link}</td>
          <td>{url}</td>
          <td>{target}</td>
        </tr>
      </table>
    </div>
    </body>
    </html>

    It would be helpfull if you actually created an <img> tag to start with
    <img src="{image/@src}" />
    would work.

  • Find first record in a set of record

    I want to find first record in a set of record .What built in function shall i use and which trigger should I use.Please help.

    Hi,
    First_record takes you to the position of that first record, but doesn't gives you the value of the record, you have to get it form the :block_name.item_name
    Jose.

  • How do I add my own headers to the default set of request headers without using a plug-in?

    When I open HTTP Live Headers, I see that there are default request headers that go out from the browser to the server. I want to add a Pragma header with a specific value to be sent. This will help me to remove a plug-in from my arsenal and thereby be sure that all the request headers are going as a part of the request.

    I think this probably requires an extension. As far as I know, there is no preference you could change in about:config or user.js to "add a header".
    Or are you generating the request with JavaScript?

  • How do I add a mobile device to an already set up wireless printer.

    Hw do I add a mobile device to my all ready set up wireless printer, I have the C410A all in one printer.

    Hi,
    The printer is connected directly (wireless) to other device or thru the Network ?
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Split R3 table's records into detailed set of records for extracting to BI

    Hello, everybody,
    In R3 table i have records:
    <i>Document_numberA-Material_numberA-Date1-Date2-Date3-Amount1-Amount2---Amount3</i>
    I have extract data to BI ODS in format:
    <i>Document_numberA-Material_numberA-Date1---Amount1
    Document_numberA-Material_numberA-Date2---Amount2
    Document_numberA-Material_numberA-Date3---Amount3</i>
    <i>Document_numberB-Material_numberB-Date1---Amount1</i>
    How i have define extractor and loading mechanism?
    Could you give me a suggestion?
    Thanks in advance.
    Best Regards,
    Arunas Stonys

    Hello, everybody,
    I have created a START ROUTINE, but it doesn't replaces <b>YEARS</b> and <b>AMOUNTS</b>.
    <b>Code:</b>
    PROGRAM trans_routine.
          CLASS routine DEFINITION
    CLASS lcl_transform DEFINITION.
      PUBLIC SECTION.
    Attributs
        DATA:
          p_check_master_data_exist
                TYPE RSODSOCHECKONLY READ-ONLY,
    *-    Instance for getting request runtime attributs;
        Available information: Refer to methods of
        interface 'if_rsbk_request_admintab_view'
          p_r_request
                TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
      PRIVATE SECTION.
        TYPE-POOLS: rsd, rstr.
      Rule specific types
        TYPES:
          BEGIN OF tys_SC_1,
         Field: BANFN Paraiškos nume..
            BANFN           TYPE C LENGTH 10,
         Field: BANFPO Paraiškos pozc..
            BANFPO           TYPE N LENGTH 5,
         Field: TXZ01 Pavadinimas.
            TXZ01           TYPE C LENGTH 40,
         Field: FISTL L&#279;š&#371; centras.
            FISTL           TYPE C LENGTH 16,
         Field: FKBER Programa.
            FKBER           TYPE C LENGTH 16,
         Field: FIPOS Biudž.straips..
            FIPOS           TYPE C LENGTH 14,
         Field: GEBER Finan. šaltinis.
            GEBER           TYPE C LENGTH 10,
         Field: FIPEX Straipsnis.
            FIPEX           TYPE C LENGTH 24,
         Field: ZZYEAR1 Metai 1.
            ZZYEAR1           TYPE N LENGTH 4,
         Field: ZZYEAR2 Metai 2.
            ZZYEAR2           TYPE N LENGTH 4,
         Field: ZZYEAR3 Metai 3.
            ZZYEAR3           TYPE N LENGTH 4,
         Field: ZZSUM1 Suma 1.
            ZZSUM1           TYPE P LENGTH 7 DECIMALS 2,
         Field: ZZSUM2 Suma 2.
            ZZSUM2           TYPE P LENGTH 7 DECIMALS 2,
         Field: ZZSUM3 Suma 3.
            ZZSUM3           TYPE P LENGTH 7 DECIMALS 2,
         Field: WAERS Valiuta.
            WAERS           TYPE C LENGTH 5,
         Field: BSART Paraiškos tipas.
            BSART           TYPE C LENGTH 4,
         Field: ERDAT Pakeista.
            ERDAT           TYPE D,
         Field: RECORD Record Number.
            RECORD           TYPE RSARECORD,
          END   OF tys_SC_1.
        TYPES:
          tyt_SC_1        TYPE STANDARD TABLE OF tys_SC_1
                            WITH NON-UNIQUE DEFAULT KEY.
    $$ begin of global - insert your declaration only below this line  -
    ... "insert your code here
    $$ end of global - insert your declaration only before this line   -
        METHODS
          start_routine
            IMPORTING
              request                  type rsrequest
              datapackid               type rsdatapid
            EXPORTING
              monitor                  type rstr_ty_t_monitors
            CHANGING
              SOURCE_PACKAGE              type tyt_SC_1
            RAISING
              cx_rsrout_abort.
        METHODS
          inverse_start_routine
            IMPORTING
              i_th_fields_outbound         TYPE rstran_t_field_inv
              i_r_selset_outbound          TYPE REF TO cl_rsmds_set
              i_is_main_selection          TYPE rs_bool
              i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
              i_r_universe_inbound         TYPE REF TO cl_rsmds_universe
            CHANGING
              c_th_fields_inbound          TYPE rstran_t_field_inv
              c_r_selset_inbound           TYPE REF TO cl_rsmds_set
              c_exact                      TYPE rs_bool.
    ENDCLASS.                    "routine DEFINITION
    $$ begin of 2nd part global - insert your code only below this line  *
    ... "insert your code here
    $$ end of 2nd part global - insert your code only before this line   *
          CLASS routine IMPLEMENTATION
    CLASS lcl_transform IMPLEMENTATION.
          Method start_routine
          Calculation of source package via start routine
      <-> source package
      METHOD start_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <SOURCE_FIELDS>    TYPE tys_SC_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    *$*$ begin of routine - insert your code only below this line        *-*
    ... "insert your code here
        DATA:
              ls_SOURCE_PACKAGE type tys_SC_1,
              lt_SOURCE_PACKAGE like table of ls_SOURCE_PACKAGE,
              l_tabix like sy-tabix.
        loop at SOURCE_PACKAGE into ls_SOURCE_PACKAGE.
           l_tabix = sy-tabix.
           ls_SOURCE_PACKAGE-BANFN   = ls_SOURCE_PACKAGE-BANFN.
           ls_SOURCE_PACKAGE-BANFPO  = ls_SOURCE_PACKAGE-BANFPO.
           ls_SOURCE_PACKAGE-TXZ01   = ls_SOURCE_PACKAGE-TXZ01.
           ls_SOURCE_PACKAGE-FISTL   = ls_SOURCE_PACKAGE-FISTL.
           ls_SOURCE_PACKAGE-FKBER   = ls_SOURCE_PACKAGE-FKBER.
           ls_SOURCE_PACKAGE-FIPOS   = ls_SOURCE_PACKAGE-FIPOS.
           ls_SOURCE_PACKAGE-GEBER   = ls_SOURCE_PACKAGE-GEBER.
           ls_SOURCE_PACKAGE-FIPEX   = ls_SOURCE_PACKAGE-FIPEX.
           ls_SOURCE_PACKAGE-WAERS   = ls_SOURCE_PACKAGE-WAERS.
           ls_SOURCE_PACKAGE-BSART   = ls_SOURCE_PACKAGE-BSART.
           ls_SOURCE_PACKAGE-ERDAT   = ls_SOURCE_PACKAGE-ERDAT.
           ls_SOURCE_PACKAGE-RECORD  = ls_SOURCE_PACKAGE-RECORD.
           ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR1.
           ls_SOURCE_PACKAGE-ZZSUM1  = ls_SOURCE_PACKAGE-ZZSUM1.
           append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
           ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR2.
           ls_SOURCE_PACKAGE-ZZSUM1 = ls_SOURCE_PACKAGE-ZZSUM2.
           append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
           ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR3.
           ls_SOURCE_PACKAGE-ZZSUM1 = ls_SOURCE_PACKAGE-ZZSUM3.
           append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
           delete SOURCE_PACKAGE index l_tabix.
        endloop.
        move lt_SOURCE_PACKAGE[] to SOURCE_PACKAGE[].
    *--  fill table "MONITOR" with values of structure "MONITOR_REC"
    *-   to make monitor entries
    ... "to cancel the update process
       raise exception type CX_RSROUT_ABORT.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "start_routine
          Method inverse_start_routine
          This subroutine needs to be implemented only for direct access
          (for better performance) and for the Report/Report Interface
          (drill through).
          The inverse routine should transform a projection and
          a selection for the target to a projection and a selection
          for the source, respectively.
          If the implementation remains empty all fields are filled and
          all values are selected.
      METHOD inverse_start_routine.
    $$ begin of inverse routine - insert your code only below this line-
    ... "insert your code here
    $$ end of inverse routine - insert your code only before this line -
      ENDMETHOD.                    "inverse_start_routine
    ENDCLASS.                    "routine IMPLEMENTATION
    <b>Could you look at code and tell what is wrong?</b>
    Thanks in advance!
    Best Regards,
    Arunas Stonys
    Arunas Stonys

  • Picking unique records from huge set of records

    Hi db experts,
    Could anyone help me in having a query which is based on partitioned table with 400,00,000 records each day . It has member number unique and I want to pick unique ones say for dates between 20-jan-2007 and 20-apr-2007.
    How can I proceed to write query. Am expecting query which will only pull unique records in less possible time.
    Thanks in advance
    Ravikanth

    The table has 400 lakh records each day my mistake - I misread the original post.
    Is this a one-off exercise or an ongoing requirement? What are you going to do with the data once you've got it - do you need more columns than the numbers? Do you have a feel for how many unique numbers there are per day and over the entire quarter?
    The easiest way to do this would probably be to create an extract table (maybe a temporary one) and vary the query I posted to insert the unique numbers into this table for each day i.e. run it multiple times against a smaller data set. Then you can select the unique numbers from the extract table to get the finished set.
    Of course, whether this is a viable solution depends on the answers to the questions I posed above. The more information you give us the easier it is for us to advise you.
    Cheers, APC

  • How can I add a privacy statement to my outgoing emails, below my signature?

    I'm a therapist and need to have a privacy statement/disclaimer below my signature on my outgoing emails...something like the following:
    STATEMENT OF CONFIDENTIALITY AND PRIVILEGE
    The contents of this e-mail (including its attachments) are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. Any other distribution, copying or disclosure is strictly prohibited. Email is not a secure medium of communication and should not be used for transmitting private and confidential information.
    How do I add this?? thanks, Karen

    You can set up multiple signatures and select the appropriate one. Or use stationery where the signature and disclaimer are part of the template document. Or use a text clippings tool to insert ready-to-go frequently used snippets such as your disclaimer text. Many users make use of such a tool in lieu of a prepared signature.

  • Layout Set: How to add a new field in a layout Set?

    Hi ABAPPERS.
    Question:
    How can I add a new field in a layout set?
    Scenario:
    QC21 uses a global Layout Set ZQMECOA_GLOBAL.
    There's a field required in this Layout Set which is Production Date(CAUFVD-GLTRP).
    Where is the date query happening here?
    Where can I insert the SELECT statement for the new field required?
    I try to look at:
    OPEN_FORM and WRITE_FORM, it seems that date query or SELECTION of data is not happening here.
    Thanks.

    If you are adding a header field then you will extend the header structure in CRM and do the same with Item structures for Item fields. You will use EEWB or similar technique in the CRM backend to extend the header or item.
    These extended fields in the backed are available in customer_h or _i structures in the order object that can be read and modified in the Header BAdI or Item BAdi.
    If you think that this message is cryptic or not enough, then you should search for Extension Guide in this forum and read the document.

  • How do I add multiple text block records from text file?

    The data manager documentation (page 151) for MDM 5.5 SP3 indicates that one or more new text blocks can be added to the Text Blocks object table from files. It is noted that the files must be plain text files.
    I use notepad and create a text file with two lines as follows:
    Test 1
    Test 2
    When I try to add the text blocks following documentation mentioned above, it only adds one record for the Data Group I have chosen and the record contains the entry "Test 1" from the first line in the text file.
    How can I add multiple records to the data group from a file?

    From my testing it appears that you need to have one text file per text block record in Data Manager.
    I wrote VBA macro to so that I could input my text blocks into an Excel spreadsheet and then the macro will take the contents of each cell in a highlighted column and create one text file per cell.
    Then using Data manager, I can select all of the text files at once and it will import them, creating one record per text file.

  • How can I add a new record in an Access table.

    How can I add a new record in access with LabView, using activex, without using the database connectivity tools.
    Message Edited by Noawena on 05-16-2008 09:25 AM

    Much easier with a toolkit but you could use ADO objects,
    get connection, make a SQL object "INSERT record INTO table where  ...." 
    Execute the parameterized query
    Free up record sets data
    close connection when done.
    This is a very simplified version
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • How can I add new content in iDVD to a DVD-RW disc which has ample remaining free space? After preparing the new video for burning and clicking on Burn to iDVD, I get a window saying the disc's already recorded and that I can either Erase or Eject.

    How can I add new content in iDVD to a DVD-RW disc with a video previously successfully recorded on it? (The disc has ample remaining free space.)
    After preparing the new video for burning and clicking in the File menu on Burn to iDVD, I get a window saying the disc's already recorded and that I can either Erase or Eject. My assumption has been that iDVD would automatically find the free space and continue with the new recording from there. I'd be grateful if anyone can shine light on this.

    There are, but not with a DVD written as a movie disk. It must be closed when completed, or it doesn't work.
    Apple's built in Burn utility also automatically closes any data CD, DVD or Blu-ray disk you burn. Doesn't matter how much space is unused, you can't use it. You'd have to use a more advanced disk creation app, such as Toast Titanium. I then have the option of choosing to write the data as a session:
    I can keep doing this until the disk is full. If I've written five sessions to the disk, when I put it in the drive, five CD/DVD icons will appear on the desktop since the OS will treat each session as if they are separate physical disks. At any point you choose Write Disk when writing a group of data, that means you're closing the disk, and again can't add anything after that. So if I had written two sessions, and the third was Write Disk, it's over. I can't put anything else on that disk.

  • How do I add SRV record to my DNS for Office 365?

    How do I add the following record?
    Add the SIP SRV record for Lync web conferencing.
    Create a new SRV record.
    In the new record, make sure that the fields are set to precisely the following values:
    Record Type: SRV
    Service: _sip
    Protocol: _tls
    Port: 443
    Weight: 1
    Priority: 100
    TTL: Set this value to 1 hour or to the equivalent in minutes (60), seconds (3600), etc.
    Name: @
    Target: sipdir.online.lync.com
    Save the record.
    Need help ASAP because my clients Email is down when I changed Domain Name Servers to Business Catalyst.
    All Office 365 functions were lost.
    Thank you for some assistance - URGENT,
    Jim Vernon
    Hopegate Software

    Here is an image of the settings that Office 365 says i need to correct in my DNS settings on Business Catalyst:

  • How does one add a personal recorded M4R file to the ring tones in the UK system for iPhone 3GS

    How does one add a personal recorded M4R file to the ring tones in the UK system for iPhone 3GS.
    I have tried all sorts of ways of adding my personal M4R file but can't find the place (within the UK versions of iTunes} to transfer this file so that I can select it as a ring tone.
    I've tried also changing to the US version of iTunes and still can't find a way of doing it, although I have heard that it can be done.

    You should be able to just drop it into the library within iTunes.
    http://cnettv.cnet.com/create-free-iphone-ringtones-using-itunes-8-0/9742-1_53-5 0003920.html
    Check out the video above for a lot good info. The ringtone must be less than 35 seconds.

  • How do I add music from a music cd on a MacBook Pro?  Up until this morning I got a window that asked me if I wanted to record or play the cd I just inserted.  Now that window no longer appears.  Any suggestions on how to rectify this?

    How do I record music from a music cd to my MacBook Pro?  Up until this morning I would get a pop up window that asked if I wanted to play or record the disc I just put in.  That screen no longer appears - a disk starts to play.  I can stop the auto play but how do I add the music to my existing music collection?
    Thanks

    Do you mean "how do you rip a CD to iTunes?" If so, just insert the CD into the optical drive of the MBP, launch iTunes, edit the ID3 tags to show what you want, then click the "import" button in the lower right corner of the window.

Maybe you are looking for

  • Why does everyone at my work loose their internet connection when I update Adobe Cloud Products?

    Why does everyone at my work loose their internet connection when I update Adobe Cloud Products? We are on a 20mb broadband connection and there is around 20 people using computers at my work but when I start my Adobe Cloud Product update or when I t

  • Zen micro 6gb trouble with transfering music to the player pls h

    I bought on ebay. It's used i download the cd installation. Tried to transfer with media explorer and windows media player, it wont work. The player seems "locked" when ever its connected it wont show the music inside of it, just displays the folders

  • Pin code not accepted in new IOS 7.0.2

    Today I was asked to update my iPad to the new iOS - which I duly did. Then it asked me to put in a pin code for security. THis was OK and I put it in twice as requested - now what I thought was the code is not accepted and the Ipad is disabled. Help

  • Scenario for Report Painter

    Hello, Can anyone provide me some scenarios to prepare some reports in Report Painter. basically I am BW but trying to learn little more abt FICO and its related reporting tools. I already have the one which is @ http://www.virtuosollc.com/PDF/Get_Re

  • Oracle Intelligent Agent Exe encountered a problem and needed to close

    Whenever the server is rebooted I get the error "Oracle Intelligent Agent Executable encountered a problem and needed to close". The agent won't start, and I found a work around that included deleting files from the network/agent and admin folders, t