Please help with a query were struggling with.

Any help please, were struggling to get the result we require.
We have Scheduled data returned from another program(job table). Shows our jobs 1 through 9 and the time that each job is loaded on a machine.
i.e. if you look at the job table, job 1 is using machine 1 between 01-01-08 08:00 and 10-01-08 10:00.
We then have a calendar table that shows our hours the machine is able to work.
So machine 1 is available between 9-5.30 mon-fri but is not available on sat and Sunday.
What we need to do is produce a graph that shows the time per day each machine is loaded.
So if you see the result at the bottom, were hoping for something similar which shows for each machine, every day it is loaded and for how many hours.
Thanks in advance
Job TABLE with 4 columns
JOB NUMBER
MCR NUMBER
START DATE
FINISH DATE
1,1,01-01-08 08:00, 10-01-08 10:00
2,1,02-01-08 08:00, 03-01-08 10:00
3,1,04-01-08 08:00, 04-01-08 10:00
4,1,26-01-08 08:00, 26-01-08 10:00
5,1,19-01-08 08:00, 26-01-08 10:00
6,1,20-01-08 08:00, 21-01-08 10:00
7,2,01-01-08 08:00, 10-01-08 10:00
8,2,02-01-08 08:00, 03-01-08 10:00
9,2,05-01-08 08:00, 06-01-08 10:00
Calender TABLE WITH 3 COLUMNS
MCR     NUMBER
START     DATE
END     DATE
1,MON 09-30, MON 17-30
1,TUE 09-30, MON 17-30
1,WED 09-30, MON 17-30
1,THU 09-30, MON 17-30
1,FRI 09-30, MON 17-30
1,SAT 00-00, MON 00-00
1,SUN 00-00, MON 00-00
RESULT
MCR
DATE IN USE
HOURS IN USE
1,01-01-08,8
1,02-01-08,16
1,03-01-08,16
1,04-01-08,10
1,05-01-08,0
1,06-01-08,0
etc
Obviously these are not real figures but hopefully you get the idea!

Thanks Keith.
SQL> create table job_table
  2  as
  3  (
  4  select 1 machine_id,to_date('01-01-08 08:00','dd-mm-yy hh24:mi') started, to_date('10-01-08 10:00','dd-mm-yy hh24:mi') finished fr
om dual union all
  5  select 1,to_date('02-01-08 08:00','dd-mm-yy hh24:mi'), to_date('03-01-08 10:00','dd-mm-yy hh24:mi') from dual union all
  6  select 1,to_date('04-01-08 08:00','dd-mm-yy hh24:mi'), to_date('04-01-08 10:00','dd-mm-yy hh24:mi') from dual union all
  7  select 1,to_date('26-01-08 08:00','dd-mm-yy hh24:mi'), to_date('26-01-08 10:00','dd-mm-yy hh24:mi') from dual union all
  8  select 1,to_date('19-01-08 08:00','dd-mm-yy hh24:mi'), to_date('26-01-08 10:00','dd-mm-yy hh24:mi') from dual union all
  9  select 1,to_date('20-01-08 08:00','dd-mm-yy hh24:mi'), to_date('21-01-08 10:00','dd-mm-yy hh24:mi') from dual union all
10  select 2,to_date('01-01-08 08:00','dd-mm-yy hh24:mi'), to_date('10-01-08 10:00','dd-mm-yy hh24:mi') from dual union all
11  select 2,to_date('02-01-08 08:00','dd-mm-yy hh24:mi'), to_date('03-01-08 10:00','dd-mm-yy hh24:mi') from dual union all
12  select 2,to_date('05-01-08 08:00','dd-mm-yy hh24:mi'), to_date('06-01-08 10:00','dd-mm-yy hh24:mi') from dual
13  );
Table created.
SQL> create table calendar_table as
  2  (
  3  select 1 machine_id,'MON 09-30' startdate , 'MON 17-30' enddate from dual union all
  4  select 1,'TUE 09-30', 'TUE 17-30' from dual union all
  5  select 1,'WED 09-30', 'WED 17-30' from dual union all
  6  select 1,'THU 09-30','THU 17-30' from dual union all
  7  select 1,'FRI 09-30','FRI 17-30' from dual union all
  8  select 1,'SAT 00-00','SAT 00-00' from dual union all
  9  select 1,'SUN 00-00','SUN 00-00' from dual
10  );
Table created.
SQL> select j.machine_id
  2       , trunc(j.startdate) day_in_use
  3       , sum
  4         (  least(j.enddate,trunc(j.startdate) + (c.enddate-trunc(c.enddate)))
  5          - greatest(j.startdate,trunc(j.startdate) + (c.startdate-trunc(c.startdate)))
  6         ) * 24 hours_in_use
  7    from ( select j.machine_id
  8                , greatest(j.started,trunc(j.started) - 1 + row_number() over (partition by j.rowid order by null)) startdate
  9                , least(j.finished,trunc(j.started) + row_number() over (partition by j.rowid order by null)) enddate
10             from job_table j
11                , table
12                  ( cast
13                    ( multiset(select null from dual connect by level <= trunc(j.finished) - trunc(j.started) + 1)
14                      as sys.dbms_debug_vc2coll
15                    )
16                  ) t
17         ) j
18       , ( select machine_id
19                , substr(enddate,1,3) dayofweek
20                , to_date(substr(startdate,5),'hh24-mi') startdate
21                , to_date(substr(enddate,5),'hh24-mi') enddate
22             from calendar_table
23            where enddate not like '___ 00-00'
24         ) c
25   where c.machine_id = j.machine_id
26     and c.dayofweek = to_char(j.startdate,'DY','nls_date_language=american')
27   group by j.machine_id
28       , trunc(j.startdate)
29   order by j.machine_id
30       , trunc(j.startdate)
31  /
                            MACHINE_ID DAY_IN_USE                                    HOURS_IN_USE
                                     1 01-01-2008 00:00:00                                      8
                                     1 02-01-2008 00:00:00                                     16
                                     1 03-01-2008 00:00:00                                    8.5
                                     1 04-01-2008 00:00:00                                    8.5
                                     1 07-01-2008 00:00:00                                      8
                                     1 08-01-2008 00:00:00                                      8
                                     1 09-01-2008 00:00:00                                      8
                                     1 10-01-2008 00:00:00                                     .5
                                     1 21-01-2008 00:00:00                                    8.5
                                     1 22-01-2008 00:00:00                                      8
                                     1 23-01-2008 00:00:00                                      8
                                     1 24-01-2008 00:00:00                                      8
                                     1 25-01-2008 00:00:00                                      8
13 rows selected.Regards,
Rob.

Similar Messages

  • Please help me! I am struggling with the mesh tool!

    So I want to make this chair look like it does in the picture, but I cant! There is a chapter in my Illustrator CS3 book explaining how to use gradient mesh and mesh tool, but it doesnt help me at all. I am clueless!   The tutorial says that I can create points in the mesh simply by clicking with the mesh tool within an object, but when I try to do that, the pointer is "crossed out". I can only add extra points on lines or edges, but not on empty space within an object. What gives? Why is it that others can do it an I cant? Forgive me if I sound a little too upset, but I've been struggling with this for days and I cannot find an answer.
    In this tutorial right here: http://www.layersmagazine.com/illustrator-gradient-mesh-tool.html the guy just clicks in empty spaces creating intersections. In my case it is impossible.
    PS: Please look at an attached file and tell me what would be the best way to go about coloring this chair. Maybe I am doing this completely wrong? (I only started learning illustrator about 5 weeks ago)
    Sorry for the background template being of poor quality, but this was taken from a book and scanned, so it's the best I could do.

    You know something I think there should be a behavioral change in this case. To my way of thinking this option should automatically be disabled if you select the Mesh tool. If for some reason you want the mesh tool not to behave the way there might be a toggle or a double click to get the preferences for the tool 's behavior itself. I can see where this behavior can be useful but there needs to be a toggle.
    Selecting the anchors for adding color with out accidentally creating a new mesh division is good thing but you need to be able to work both ways.
    What do you think Scott Weichert you use the tool extensively, am i wrong?

  • Please help to get onhand stock report with last purchase and billed date warehouse and item wise

    please help to get onhand stock report with last purchase and billed date warehouse and item wise

    Hi Rajeesh Ambadi...
    Try This
    SELECT distinct T0.ITEMCODE , t1.ItemName, T0.ONHAND as 'Total Qty',  
      T1.LASTPURDAT ,t1.LastPurPrc
    FROM OITW T0 INNER JOIN OITM T1 ON T0.ITEMCODE = T1.ITEMCODE
    INNER JOIN OITB T2 ON T1.ITMSGRPCOD=T2.ITMSGRPCOD left join ibt1 t3 on t3.itemcode = t0.itemcode and t3.whscode = t0.whscode
    WHERE
    T0.ONHAND>0
    AND T0.WhsCode ='[%0]'
    Hope Helpful
    Regards
    Kennedy

  • Please help me creating a new listener with different port#.

    I have two instances in a server. both have different homes. I want to create a seperate listener for the second one i created.
    But that is not happening.
    here i tried to give name from LISTENER TO LISTENER1 & Port# from 1521 to 1524.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /apps2/oracle)
    (PROGRAM = extproc)
    LISTENER1 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = aixth53)(PORT = 1524))
    When I check lsnrctl status with LISTENER1 , it still shows the other instance home with port#: 1521
    Please help me creating a new listener with different port#.
    Thanks,

    marist89 wrote:
    sb92075 wrote:
    marist89 wrote:
    sybrand_b wrote:
    The listener is a broker only and doesn't play any role in normal communications.
    It just forks a process or a thread, and that's it.And the listener is a single point of failure. Listener goes down, you can't connect to the db. That's why you need two listeners.If listener one goes down, then listener two goes down for exact same reason since it is a single executable file.I'm not playing tit-for-tat with you. Fact is, there are situations where people who are not you might want to use more than one listener.Some folks might want to jab a sharp pencil into their eye, too.
    Just because you can do something, it does not necessarily mean it should be done.

  • Please help me in resolving the URL with parameters.

    Hello,
    Please help me in resolving the URL with parameters. If desformat is pdf, a pop up message �Acrobat Reader could not open �pa034922.fdf� because it is either not a supported file type or because the file has been corrupted���.
    if desformat is html or xml, the following URL is working.
    our requirement, report should be in pdf format.
    http://servername:7778/dev60cgi/rwcgi60?server=Rep60_mclaren&&userid=bizsystest/test@business&destype=cache&desformat=pdf&report=salary_dept.rdf&p_dept_list=''ABE','ASE','CE','CHE','CS','DE','DIAL','ECE','ERC','IE','ME','PTE','ARC','ASE1''&p_status_list=''ACP','AD','AP','ATP','D','FE','HD','INS','P','RP','S','TF','TP','TS','ST','GS','O''&p_sex=''M','F''&p_order_by='Name'&p_totals='NO'
    Thanks in advance,
    Usha

    We've seen this bug on machines running IE6 with a certain security patch (I forget its number). There's a thread in the Metalink reports forum about it. It appears to be somewhat tied to another problem where IE runs the report twice (you can see that in Showjobs. You're seeing the problem in 6i; I believe it persists in 9i.
    The workarounds are (1) set Acrobat so it doesn't open within IE or (2) switch to a different browser, like Netscape. For workaround 1, Start Acrobat Reader, Choose File -> Preferences -> General, Uncheck Web Browser Integration
    There's some evidence that it occurs more often with urls that include single quote characters. I think it's worse with XP, but I don't have any proof.
    If you check Adobe's site, you will see this isn't just an Oracle Reports problem. I think we're waiting for Microsoft on this one, so don't hold your breath for a quick fix.
    -- jim

  • Yesterday I have purchased Ipad2 with 3G but did not able see in built aceTime on my scree do we need to Install? please Help, yesterday I have purchased Ipad2 with 3G but did not able see in built FaceTime on my scree do we need to Install? please Help

    yesterday I have purchased Ipad2 with 3G but did not able see in built aceTime on my scree do we need to Install? please Help, yesterday I have purchased Ipad2 with 3G but did not able see in built FaceTime on my scree do we need to Install? please Help.

    See this support doc on how to use FT... http://support.apple.com/kb/HT4319

  • Can anyone please help me, I'm having problems with sound while watching video clips using flash player using Internet Explorer\

    Can anyone please help me, I'm having problems with sound while watching video clips using flash player & Internet Explorer

    There's a good chance that this is a known issue.  We'll have a Flash Player 18 beta later this week that should resolve this at http://www.adobe.com/go/flashplayerbeta/

  • Why does iMessages does not work properly ? Please help me ! Its works better with the previous version if compared with the latest iOS

    Why does iMessages does not work properly ? Please help me ! Its works better with the previous version if compared with the latest iOS

    Many, many thanks for both of you Todd and Rick.
    to Rick:
    I suppose you mean the Color Settings in Project Settings as follows:
    - Working Space: None
    - Match Legacy ... Gamma Adjustments checked ON
    But it does not correct the colors in effects. And checking or unchecking Make Movie/Output Module Settings/Color Management/Profile/Preserve RGB does not make any difference.
    to both of you:
    Those parts of the video image that does not have color effects are just fine. In these parts the color is preserved when reimporting to FCP. However, those parts having color effects (except Levels, as decribed earlier) have altered color results. So, only the parts having effects affecting color are misinterpreted in the image area. The mismatch is of course seen in AE, before making the movie.
    What I ment with "Color Management not working properly" is that (instead of "disabling" it) Color Management does not seem to be able to correct this "misinterpretation" or difference in effect handling between AE 6 and 10.
    So, would you have any solution for this problem?
    Again, many thanks for your fast replies!

  • Please help us, we have a problem with loading a page is slow we have to wait a longer time to open our one page, thanks in advance

    Please help us, we have a problem with loading a page is slow we have to wait a longer time to open our one page, thanks in advance

    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • HT1689 Hi, please can someone refer me to an e-mail address whereby I can request an Apple Technician to assist me with a query I have with my iPhone 4s and iTunes and syncing with a new PC? thanks

    Hi, please can someone refer me to an e-mail address whereby I can request an Apple Technician to assist me with a query I have with my iPhone 4s and iTunes and syncing with a new PC? thanks
    <Email Edited By Host>

    There is no email support. Either call AppleCare or use this:
    http://www.apple.com/support/iphone/contact/

  • HT4061 HI... i want to replace my front screen of 4S. Please help me to identify original screen with fakes?

    i want to replace my front screen of 4S. Please help me to identify original screen with fakes?

    Apple does not sell parts.
    Either get the entire device replaced under Out of Warranty exchange or take your chances with non-oem parts.

  • Please Help for the Query

    Please Help for the Query
    Hi frds please help me for the below query.What I want to do is to pull out the data from below table :-
    date ticker indicator
    03/13/2008 3IINFOTECH -8
    03/18/2008 3IINFOTECH -4
    03/25/2008 3IINFOTECH -5
    03/27/2008 3IINFOTECH -3
    as such :-
    date ticker indicator
    03/13/2008 3IINFOTECH -8
    03/25/2008 3IINFOTECH -5
    03/27/2008 3IINFOTECH -3
    Here I want to find the Trend i.e either asc or desc order from the lowest indicator.
    In the above sample data -8, -4, -5, -3 out of which I want the asc order data -8, -5, -3 and exclude -4 data.Because the asc order -8, -5, -3 will not follow.
    So I want the data
    date ticker indicator
    03/13/2008 3IINFOTECH -8
    03/25/2008 3IINFOTECH -5
    03/27/2008 3IINFOTECH -3

    SQL> CREATE TABLE BORRAME(FECHA DATE, INDICA VARCHAR2(100));
    Tabla creada.
    SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/13/2008','MM/DD/YYYY'), '3IINFOTECH -8');
    1 fila creada.
    SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/18/2008','MM/DD/YYYY'), '3IINFOTECH -4');
    1 fila creada.
    SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/25/2008','MM/DD/YYYY'), '3IINFOTECH -5');
    1 fila creada.
    SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/27/2008','MM/DD/YYYY'), '3IINFOTECH -3');
    1 fila creada.
    SQL> COMMIT;
    Validación terminada.
    SQL>
    SQL> SELECT FECHA, INDICA
      2  FROM BORRAME
      3  WHERE SUBSTR(INDICA,INSTR(INDICA,'-',1)+1,LENGTH(INDICA)) <> '4'
      4  ORDER BY SUBSTR(INDICA,INSTR(INDICA,'-',1)+1,LENGTH(INDICA)) DESC;
    FECHA                                                                
    INDICA                                                               
    13/03/08                                                             
    3IINFOTECH -8                                                        
    25/03/08                                                             
    3IINFOTECH -5                                                        
    27/03/08                                                             
    3IINFOTECH -3                                                        
                    

  • Please Help... Sync BB8900 with Outlook 2007 and Vista.

    I have trawled the web looking for an answer to this question and can't find any answers, please can somebody help me !!!
    I have owned my 8900 Curve for about 2 months and love it, I used to sync it with my old computer running Windows XP and Outlook 2007 and had no problems.Unfortunately that computer died and I have upgraded to a new PC unning Windows Vista, my problem is this... When I try to set up the sync options for my calendar,contacts etc I don't get the option to sync it with Outlook, I only get the option to sync it with
    1... ASC II Importer/exporter
    2...Yahoo.
    I rely heavily on my BB being up to date and without this function may as well go back to my old PDA.
    I have tried re-installing Desktop Manager a few times and even downloading older versions of it to see if this fixes my problem, all to no avail.
    Please,Please can somebody help.
    Thank You In Advance.
    Stuart

    Hi,
    By the "media control" I take it your were referring to the Vizkids Post, suggesting the mediad manager not be installed?
    I didn't say that, I agree with it, but I didn't say it.
    Stulew99 Wrote:  
    "Why we should have to do this I have no idea, surely if something is
    sold with an application then it should work with the latest operating
    system and latest outlook version)."
     A friendly tip as this is your first thread, The User who suggested that has 4 more posts than you. He is new to the forum as well.
     What worked for his problem, might not work for yours, in this case it wouldn't have affected it at all. When you get stuck or need some
    research go to the upper left hand corner where the grey search box is. Type on keyword for your problem, I would put vista outlook 2007
    desktop, to start. You will see the history of the problems reading those subjects. You will see green resolution marked on most
    Follow those resolved threads and see how it relates to yours, and how it was resolved in the past.  Be sure to write your search results in  you thread other users can then see what you've tried and found and help you quicker
    As you get more experience you will get good use from the Support and Services grey tab at the top of the page.
    That's where the link I posted came from.  Please take my comments the way they were intended, as helpful advice, OK?
     I need some specifics on your Vista OS 32 or 64 bit?What version of desktop manage have you tried, removed reinstalled etc.?
    Okay flesh things out a little, you installed desktop manager with full access rights as an administer on Vista,correct?
    The installation was error free?
    You setup the   your email and when you went to configure the synchronization options, you had what options, I know
    you didn't have Outlook.
    What steps did you try to resolve the problem? 
    Did you change any settings in Outlook, review the desktop setup in the manual?
    How far did you get on article I left you regarding MS Outlook tips?
    Ok let me know the detail for those questions,thanks,
    Regarding the clean procedure post, The first part of the procedure states:
    "To install BlackBerry Desktop Software on a Windows® based computer that
    had a previous version of BlackBerry Desktop Software installed,
    complete the five tasks outlined below. These tasks should also be
    completed if the BlackBerry Desktop Software installation or
    uninstallation procedures did not complete successfully."
    Going on, it explains and shows how to make sure all the registry entries, program files and remnants , along with file traces
    were made In Vista and are completely removed. A lot of desktop manager issues especially in the Vista OS can be traced to old
    registrations made by a previous DM installation.
    Please let me know what parts are not clear.
    Thanks,
    Bifocals
    http://na.blackberry.com/eng/deliverables/5837/BlackBerry_Desktop_Manager-4.7-US.pdf
    Message Edited by Bifocals on 05-12-2009 03:29 PM
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • Please help to read the XML document with XMLTable

    Hi Gurus,
    I am not very familiar with XML parsing. It seems to me it should be very easy to get the data. For some reason, I am having a problem to get the data.
    SELECT *
    FROM util.hlsr_online_entries e,
    XMLTABLE(
      xmlnamespaces(
       'http://tempuri.org/'    as "dt",
       'urn:schemas-microsoft-com:xml-diffgram-v1' as "dg"),
      '/DataTable/dg:diffgram/DocumentElement/JrShowCustomerHeifers'
      PASSING XMLTYPE(e.entry_data)
      COLUMNS
      SeqNo  FOR ORDINALITY,
      DocumentID NUMBER  PATH 'DocumentID',
      ClubName VARCHAR2(100) PATH 'ClubName') as test
    WHERE e.ref_id = 33422
    The above query does not bring any data for me. My hunts is the problem with DocumentElement tab. I have been trying a different variation to handle.
    Please help me out to tune the query
    I have the following XML document from the DotNet developer
    <?xml version="1.0" encoding="utf-8"?>
    <DataTable xmlns="http://tempuri.org/">
      <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="JrShowCustomerHeifers" msdata:UseCurrentLocale="true">
          <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="JrShowCustomerHeifers">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="DocumentID" type="xs:int" minOccurs="0" />
                    <xs:element name="ClubName" type="xs:string" minOccurs="0" />
                    <xs:element name="LastName" type="xs:string" minOccurs="0" />
                    <xs:element name="FirstName" type="xs:string" minOccurs="0" />
                    <xs:element name="PreferredName" type="xs:string" minOccurs="0" />
                    <xs:element name="Email" type="xs:string" minOccurs="0" />
                    <xs:element name="Exhibitor" type="xs:string" minOccurs="0" />
                    <xs:element name="AnimalName" type="xs:string" minOccurs="0" />
                    <xs:element name="RegistryNo" type="xs:string" minOccurs="0" />
                    <xs:element name="DateofBirth" type="xs:string" minOccurs="0" />
                    <xs:element name="NameofSire" type="xs:string" minOccurs="0" />
                    <xs:element name="SireRegistryNo" type="xs:string" minOccurs="0" />
                    <xs:element name="NameofDam" type="xs:string" minOccurs="0" />
                    <xs:element name="DamRegistryNo" type="xs:string" minOccurs="0" />
                    <xs:element name="Tattoo" type="xs:string" minOccurs="0" />
                    <xs:element name="SecondaryTattoo" type="xs:string" minOccurs="0" />
                    <xs:element name="UniversalIDNumber" type="xs:string" minOccurs="0" />
                    <xs:element name="Tattoo_Location" type="xs:string" minOccurs="0" />
                    <xs:element name="Secondary_Tattoo_Location" type="xs:string" minOccurs="0" />
                    <xs:element name="OracleBreedID" type="xs:int" minOccurs="0" />
                    <xs:element name="JrValidationBreedName" type="xs:string" minOccurs="0" />
                    <xs:element name="ValidationDate" type="xs:dateTime" minOccurs="0" />
                    <xs:element name="ValidatedBy" type="xs:string" minOccurs="0" />
                    <xs:element name="ValidationComment" type="xs:string" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:choice>
          </xs:complexType>
        </xs:element>
      </xs:schema>
      <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
        <DocumentElement xmlns="">
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers1" msdata:rowOrder="0">
            <DocumentID>18442</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>113</AnimalName>
            <RegistryNo>C1026447</RegistryNo>
            <DateofBirth>01/14/2013</DateofBirth>
            <NameofSire>808 GAME DAY 808 LH</NameofSire>
            <SireRegistryNo>C961101</SireRegistryNo>
            <NameofDam>SADDIE 7/7 LE</NameofDam>
            <DamRegistryNo>C941067</DamRegistryNo>
            <Tattoo>113</Tattoo>
            <SecondaryTattoo />
            <UniversalIDNumber>1194F020</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location />
            <OracleBreedID>6383</OracleBreedID>
            <JrValidationBreedName>Beefmaster</JrValidationBreedName>
            <ValidationDate>2014-11-25T08:39:00-06:00</ValidationDate>
            <ValidatedBy>laineyb</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers2" msdata:rowOrder="1">
            <DocumentID>18473</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>KPH PURPLE CORALEE 349</AnimalName>
            <RegistryNo>P43461953</RegistryNo>
            <DateofBirth>11/04/2013</DateofBirth>
            <NameofSire>PURPLE MOXY 22X ET</NameofSire>
            <SireRegistryNo>P43126458</SireRegistryNo>
            <NameofDam>TCC CORKY 6603</NameofDam>
            <DamRegistryNo>P42457119</DamRegistryNo>
            <Tattoo>349</Tattoo>
            <SecondaryTattoo>KPH</SecondaryTattoo>
            <UniversalIDNumber>1194F021</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
            <OracleBreedID>6389</OracleBreedID>
            <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
            <ValidationDate>2014-12-01T11:55:00-06:00</ValidationDate>
            <ValidatedBy>Hannah</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers3" msdata:rowOrder="2">
            <DocumentID>18474</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>LANGFORDS SWEET N SOUR 4107</AnimalName>
            <RegistryNo>43504761</RegistryNo>
            <DateofBirth>03/02/2014</DateofBirth>
            <NameofSire>LH TNT 1017</NameofSire>
            <SireRegistryNo>43199794</SireRegistryNo>
            <NameofDam>LANGFORDS LADY 2206 ET</NameofDam>
            <DamRegistryNo>43315143</DamRegistryNo>
            <Tattoo>4107</Tattoo>
            <SecondaryTattoo />
            <UniversalIDNumber>1194F018</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location />
            <OracleBreedID>6398</OracleBreedID>
            <JrValidationBreedName>Hereford</JrValidationBreedName>
            <ValidationDate>2014-11-24T14:26:00-06:00</ValidationDate>
            <ValidatedBy>Validator</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers4" msdata:rowOrder="3">
            <DocumentID>18475</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>PURPLE CCC LYDIA 19A</AnimalName>
            <RegistryNo>P43406978</RegistryNo>
            <DateofBirth>02/05/2013</DateofBirth>
            <NameofSire>PURPLE MB WOMANIZER 14UET</NameofSire>
            <SireRegistryNo>P42945146</SireRegistryNo>
            <NameofDam>PURPLE CMCC NASTIA 9U</NameofDam>
            <DamRegistryNo>P42927201</DamRegistryNo>
            <Tattoo>19A</Tattoo>
            <SecondaryTattoo />
            <UniversalIDNumber>1194F017</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location />
            <OracleBreedID>6389</OracleBreedID>
            <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
            <ValidationDate>2014-12-01T11:55:00-06:00</ValidationDate>
            <ValidatedBy>Hannah</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers5" msdata:rowOrder="4">
            <DocumentID>18477</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>PURPLE SGW EDEN 12B</AnimalName>
            <RegistryNo>P43521932</RegistryNo>
            <DateofBirth>04/02/2014</DateofBirth>
            <NameofSire>RST TIME'S A WASTIN' 0124</NameofSire>
            <SireRegistryNo>43123163</SireRegistryNo>
            <NameofDam>PURPLE SM WONDER WOMAN 160Y</NameofDam>
            <DamRegistryNo>P43235169</DamRegistryNo>
            <Tattoo>12B</Tattoo>
            <SecondaryTattoo>12B</SecondaryTattoo>
            <UniversalIDNumber>1194F015</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
            <OracleBreedID>6389</OracleBreedID>
            <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
            <ValidationDate>2014-12-01T11:56:00-06:00</ValidationDate>
            <ValidatedBy>Hannah</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
        </DocumentElement>
      </diffgr:diffgram>
    </DataTable>

    Hi odie_63,
    Good evening. I am not sure what you are suggesting. Please provide me the example how to solve the problem. I am very new to XML parsing.
    In the meantime, I am having another problem to get the data because .net developer changes the webservice format. To me it is supposed to work fine. May be my eyes are getting blurred so, I can't see where I am wrong.
    Thanks in advance. Please help me out.
    SELECT exh.docid,exh.clubname,exh.lname,exh.fname,exh.exhibitor,exh.animalname
    FROM util.hlsr_online_entries e,
    XMLTABLE(
      xmlnamespaces(
       'http://webservices.hlsr.net/JrShowOracleService/' as "dt",
       'urn:schemas-microsoft-com:xml-diffgram-v1'  as "dg"),
      '/dt:GetJrShowCustomerHeifersResponse/GetJrShowCustomerHeifersResult/dg:diffgram/DocumentElement/JrShowCustomerHeifers'
      PASSING XMLTYPE(e.entry_data)
      COLUMNS
      SeqNo  FOR ORDINALITY,
      DocID  NUMBER  PATH 'DocumentID',
      ClubName VARCHAR2(100) PATH 'ClubName',
      LName  VARCHAR2(100) PATH 'LastName',
      FName  VARCHAR2(100) PATH 'FirstName',
      Email  VARCHAR2(100) PATH 'Email',
      Exhibitor VARCHAR2(100) PATH 'Exhibitor',
      AnimalName VARCHAR2(100) PATH 'AnimalName', 
      RegNo  VARCHAR2(100) PATH 'RegistryNo',
      DOB  VARCHAR2(100) PATH 'DateofBirth',
      SireName VARCHAR2(100) PATH 'NameofSire',
      SireRegNo VARCHAR2(100) PATH 'SireRegistryNo',
      Dam  VARCHAR2(100) PATH 'NameofDam',
      DamRegNo VARCHAR2(100) PATH 'DamRegistryNo',
      Tattoo  VARCHAR2(100) PATH 'Tattoo',
      SecTattoo VARCHAR2(100) PATH 'SecondaryTattoo',
      UnivIDNum VARCHAR2(100) PATH 'UniversalIDNumber',
      TattooLoc VARCHAR2(100) PATH 'Tattoo_Location',
      OraBreedID NUMBER  PATH 'OracleBreedID',
      Breed  VARCHAR2(100) PATH 'JrValidationBreedName',
      ValDate  VARCHAR2(100) PATH 'ValidationDate'
      ) as exh
    WHERE e.ref_id = 33432
    <GetJrShowCustomerHeifersResponse xmlns="http://webservices.hlsr.net/JrShowOracleService/">
      <GetJrShowCustomerHeifersResult>
        <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
          <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="JrShowCustomerHeifers" msdata:UseCurrentLocale="true">
            <xs:complexType>
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="JrShowCustomerHeifers">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="DocumentID" type="xs:int" minOccurs="0"/>
                      <xs:element name="ClubName" type="xs:string" minOccurs="0"/>
                      <xs:element name="LastName" type="xs:string" minOccurs="0"/>
                      <xs:element name="FirstName" type="xs:string" minOccurs="0"/>
                      <xs:element name="PreferredName" type="xs:string" minOccurs="0"/>
                      <xs:element name="Email" type="xs:string" minOccurs="0"/>
                      <xs:element name="Exhibitor" type="xs:string" minOccurs="0"/>
                      <xs:element name="AnimalName" type="xs:string" minOccurs="0"/>
                      <xs:element name="RegistryNo" type="xs:string" minOccurs="0"/>
                      <xs:element name="DateofBirth" type="xs:string" minOccurs="0"/>
                      <xs:element name="NameofSire" type="xs:string" minOccurs="0"/>
                      <xs:element name="SireRegistryNo" type="xs:string" minOccurs="0"/>
                      <xs:element name="NameofDam" type="xs:string" minOccurs="0"/>
                      <xs:element name="DamRegistryNo" type="xs:string" minOccurs="0"/>
                      <xs:element name="Tattoo" type="xs:string" minOccurs="0"/>
                      <xs:element name="SecondaryTattoo" type="xs:string" minOccurs="0"/>
                      <xs:element name="UniversalIDNumber" type="xs:string" minOccurs="0"/>
                      <xs:element name="Tattoo_Location" type="xs:string" minOccurs="0"/>
                      <xs:element name="Secondary_Tattoo_Location" type="xs:string" minOccurs="0"/>
                      <xs:element name="OracleBreedID" type="xs:int" minOccurs="0"/>
                      <xs:element name="JrValidationBreedName" type="xs:string" minOccurs="0"/>
                      <xs:element name="ValidationDate" type="xs:string" minOccurs="0"/>
                      <xs:element name="ValidatedBy" type="xs:string" minOccurs="0"/>
                      <xs:element name="ValidationComment" type="xs:string" minOccurs="0"/>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:choice>
            </xs:complexType>
          </xs:element>
        </xs:schema>
        <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
          <DocumentElement xmlns="">
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers1" msdata:rowOrder="0">
              <DocumentID>18442</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>113</AnimalName>
              <RegistryNo>C1026447</RegistryNo>
              <DateofBirth>01/14/2013</DateofBirth>
              <NameofSire>808 GAME DAY 808 LH</NameofSire>
              <SireRegistryNo>C961101</SireRegistryNo>
              <NameofDam>SADDIE 7/7 LE</NameofDam>
              <DamRegistryNo>C941067</DamRegistryNo>
              <Tattoo>113</Tattoo>
              <SecondaryTattoo/>
              <UniversalIDNumber>1194F020</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location/>
              <OracleBreedID>6383</OracleBreedID>
              <JrValidationBreedName>Beefmaster</JrValidationBreedName>
              <ValidationDate>11/25/2014</ValidationDate>
              <ValidatedBy>laineyb</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers2" msdata:rowOrder="1">
              <DocumentID>18473</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>KPH PURPLE CORALEE 349</AnimalName>
              <RegistryNo>P43461953</RegistryNo>
              <DateofBirth>11/04/2013</DateofBirth>
              <NameofSire>PURPLE MOXY 22X ET</NameofSire>
              <SireRegistryNo>P43126458</SireRegistryNo>
              <NameofDam>TCC CORKY 6603</NameofDam>
              <DamRegistryNo>P42457119</DamRegistryNo>
              <Tattoo>349</Tattoo>
              <SecondaryTattoo>KPH</SecondaryTattoo>
              <UniversalIDNumber>1194F021</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
              <OracleBreedID>6389</OracleBreedID>
              <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
              <ValidationDate>12/01/2014</ValidationDate>
              <ValidatedBy>Hannah</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers3" msdata:rowOrder="2">
              <DocumentID>18474</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>LANGFORDS SWEET N SOUR 4107</AnimalName>
              <RegistryNo>43504761</RegistryNo>
              <DateofBirth>03/02/2014</DateofBirth>
              <NameofSire>LH TNT 1017</NameofSire>
              <SireRegistryNo>43199794</SireRegistryNo>
              <NameofDam>LANGFORDS LADY 2206 ET</NameofDam>
              <DamRegistryNo>43315143</DamRegistryNo>
              <Tattoo>4107</Tattoo>
              <SecondaryTattoo/>
              <UniversalIDNumber>1194F018</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location/>
              <OracleBreedID>6398</OracleBreedID>
              <JrValidationBreedName>Hereford</JrValidationBreedName>
              <ValidationDate>11/24/2014</ValidationDate>
              <ValidatedBy>Validator</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers4" msdata:rowOrder="3">
              <DocumentID>18475</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>PURPLE CCC LYDIA 19A</AnimalName>
              <RegistryNo>P43406978</RegistryNo>
              <DateofBirth>02/05/2013</DateofBirth>
              <NameofSire>PURPLE MB WOMANIZER 14UET</NameofSire>
              <SireRegistryNo>P42945146</SireRegistryNo>
              <NameofDam>PURPLE CMCC NASTIA 9U</NameofDam>
              <DamRegistryNo>P42927201</DamRegistryNo>
              <Tattoo>19A</Tattoo>
              <SecondaryTattoo/>
              <UniversalIDNumber>1194F017</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location/>
              <OracleBreedID>6389</OracleBreedID>
              <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
              <ValidationDate>12/01/2014</ValidationDate>
              <ValidatedBy>Hannah</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers5" msdata:rowOrder="4">
              <DocumentID>18477</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>PURPLE SGW EDEN 12B</AnimalName>
              <RegistryNo>P43521932</RegistryNo>
              <DateofBirth>04/02/2014</DateofBirth>
              <NameofSire>RST TIME&apos;S A WASTIN&apos; 0124</NameofSire>
              <SireRegistryNo>43123163</SireRegistryNo>
              <NameofDam>PURPLE SM WONDER WOMAN 160Y</NameofDam>
              <DamRegistryNo>P43235169</DamRegistryNo>
              <Tattoo>12B</Tattoo>
              <SecondaryTattoo>12B</SecondaryTattoo>
              <UniversalIDNumber>1194F015</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
              <OracleBreedID>6389</OracleBreedID>
              <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
              <ValidationDate>12/01/2014</ValidationDate>
              <ValidatedBy>Hannah</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
          </DocumentElement>
        </diffgr:diffgram>
      </GetJrShowCustomerHeifersResult>
    </GetJrShowCustomerHeifersResponse>
    Thanks again.

  • Please Help::How to display a Map with LIsts as Keys and Values using JSTL

    Hi,
    I need some assistance on how to display a Map in JSP using struts or core JSTL. I have a HashMap which has a List of keys and each key maps to a value of an ArrayList.i.e I have an ArrayList of taxCodes and each taxCode maps to a value of taxDetails which is an ArrayList of details for for that particular taxCode. I have some trouble to display each taxCode then display taxDetails for each taxCode. Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        /////This methode returns a Map which am trying to display in JSP
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
                System.out.println();
                System.out.println("*********CONSOLE OUTPUT*************");//display on console
                Set set = itemTaxDetails.keySet();
                Iterator iter = set.iterator();
                System.out.println("Key\t\tValue\r\n");
                while (iter.hasNext()) {
                    Object taxCode=iter.next();
                    Object details=itemTaxDetails.get(taxCode);
                    System.out.println(taxCode +"\t" + details);
                System.out.println("************************************");
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxDetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    LineItem itemNum = (LineItem)itemIter.next();
                    int itemNumber = itemNum.getKey_item();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        /* A HashMap of all itemTaxeCodes as its keys and an
                         * ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getOrders(String key_year,String key_office,
                String key_client,String key_company){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_office"));
                    lineOrder.setKey_client(rst.getString("key_client"));
                    lineOrder.setKey_company(rst.getString("key_company"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Simple Tax Detail Diaplay ::</title>
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <jsp:useBean id="taxDetails" class="java.util.HashMap" scope="request"/>
            <table>
                <c:forEach items="${taxDetails}" var="hMap">
                    <tr>
                        <td><c:out value="${hMap.key}" /></td>
                        <!--td><%--c:out value="${hMap.value}" /--%></td-->
                    </tr>
                </c:forEach>
            </table>
        </body>
    </html>am displaying taxCodes(in this case i have VAT and ICD) fine but cant figure out how to display a list of value for each taxCode.Here is the output am getting
    both in my JSP and on the console:
    *******************************CONSOLE OUTPUT****************************
    Key          Value
    ICD     [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    VAT [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    Edited by: aiEx on Oct 8, 2007 6:54 AM

    hi evnafets,
    yes i need a nested for loop.I have tried your advice but my bean properties are not found.Am getting this error:
    javax.servlet.ServletException: Unable to find a value for "key_item" in object of class "java.lang.String" using operator "."
    I have tried this as stated earlier in the post:I have tried to make the method getItemTaxDetails return a List and get the returned list value as taxDetails. I then tested to display this list on JSP and its displaying fine.
    public List getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            //return itemTaxDetails;
            return taxDetails;
        }And my JSP
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <table>
                <c:forEach var="curRecord" items="${taxDetails}" varStatus="rowCounter">
                        <c:choose>
                            <c:when test="${rowCounter.count % 2 == 0}">
                                <c:set var="rowStyle" scope="page" value="odd" />
                            </c:when>
                            <c:otherwise>
                                <c:set var="rowStyle" scope="page" value="even" />
                            </c:otherwise>
                        </c:choose>
                        <tr class="${rowStyle}">
                            <td>${curRecord.key_item}</td>
                            <td>${curRecord.tax_value}</td>
                            <td>${curRecord.tax_limit_val}</td>
                        </tr>
                    </c:forEach>
            </table>
        </body>
    </html>I can't see where am going wrong even with your advice.Please help.
    Thnx.

Maybe you are looking for

  • Change the background color of a table created by ADDT (Login)

    I am trying to change the background color of a table in the login form created by the developer's toolbox. I then go and select the table and change the background color. But it has no effect. The only insight I have is when I delete this "" from th

  • Notify an application user that an asynchronous call of a bi publisher report has been completed

    Hi experts, We have an ADF application (11g) from where we call BI Publisher (11g) reports by using bi publisher web services. I have the following 2 requirements: Run the reports asynchronously Notify each user that the report which has been asynchr

  • Where is the file menu on podcasts for the ipad?

    I want to subscribe to something not on podcasts shop, but I need to enter the URL.  I already know the URL but I can't find the location of the file menu.  I want to know the location of the file menu for he IPAD, not Mac.  And I don't have a Mac la

  • Toshiba AC Adapter replacemen​t

    After having many troubles diagnosing the problem with my Toshiba Satellite L350, I concluded that it keeps shutting down due to the AC Adapter problem. The adapter in question is: Input 100-240V - 50-60Hz, Output 19V - 3.95A. I have looked for this

  • Difference in stock

    Hi We are dealing with two products.One is manufactured items(we manufacture) & traded products(we buy it &sell).The issue is the increase/decrease in stock value appearing in P/L  is not tallying with the same in balance sheet.Below is the details o