SQL Query Report from DB2 Tables

Team,
Our HTML DB application requires us to build a Report against a DB2 table. In addition, we are required to view the detail of the selected DB2 data on a second page, much like the 2 page report as generated by the wizard.
So...what is the best way to present DB2 data in both Report and Detail format using HTML DB? Better yet...how can DB2 tables be set up/connected/defined to HTML DB so they operate just like the Oracle tables which reside inside the Oracle database?
Thanks for your help.
Howard

An addendum to my original post....
How about the use of a JDBC driver? Is there one available to meet my requirements?
Thanks again
Howard

Similar Messages

  • SQL Query - Report on multiple table

    Hi Experts
    Firstly, I am an amateur at generating SQL Queries!
    I am trying to create a Report of All Invoices/Credit Notes generated in a date range combined with all open Sales Orders.
    This is my attempt - I am getting all Sales Orders but only want to have Open Sales Orders.
    SELECT T0.[DocNum], T0.[DocType], T0.[cardcode] AS 'Cust. ID', T0.[cardName] AS 'Customer', T0.[TransId], T0.[TaxDate] AS 'Date', T1.[SlpName] AS 'AC Mgr', (T0.[DocTotal] -T0.[VatSum]) AS'NETT', T0.[DocStatus],T0.[U_BusCategory] AS 'Business Cat.', T0.[U_TERM] AS 'TERM', T2.OpprId, T2.Name
    FROM [dbo].[OINV]  T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode 
    LEFT OUTER JOIN OOPR T2 ON T0.U_RTNo = T2.DocNum
    WHERE CONVERT(nchar(8), T0.DocDate, 112) >= '[%0]'  AND CONVERT(nchar(8), T0.DocDate, 112) <= '[%1]'
    UNION
    SELECT T0.[DocNum], T0.[DocType], T0.[cardcode], T0.[cardName], T0.[TransId], T0.[TaxDate] AS 'Date', T1.[SlpName] AS 'AC Mgr', -(T0.[DocTotal] -T0.[VatSum]) AS'NETT', T0.[DocStatus],T0.[U_BusCategory],T0.[U_TERM] AS 'TERM', T2.OpprId AS 'Oppr. ID.', T2.Name AS 'Oppr. Name'
    FROM [dbo].[ORIN]  T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
    LEFT OUTER JOIN OOPR T2 ON T0.U_RTNo = T2.DocNum
    WHERE CONVERT(nchar(8), T0.DocDate, 112) >= '[%0]'  AND CONVERT(nchar(8), T0.DocDate, 112) <= '[%1]'
    UNION
    SELECT T0.[DocNum], T0.[DocType], T0.[CardCode], T0.[CardName], T0.[TransId], T0.[TaxDate], T1.[SlpName], (T0.[DocTotal]-T0.[VatSum]), T0.[DocStatus], T0.[U_BusCategory], T0.[U_TERM], T2.OpprId AS 'Oppr. ID.', T2.Name AS 'Oppr. Name'
    FROM ORDR T0  INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
    LEFT OUTER JOIN OOPR T2 ON T0.U_RTNo = T2.DocNum
    WHERE CONVERT(nchar(8), T0.DocDate, 112) >= '[%0]'  AND CONVERT(nchar(8), T0.DocDate, 112) <= '[%1]' 
    Any help would be much appreciated
    Derek

    Dear Mr Vard,
    The field in the ORDR table that will tell you if the document is closed or open is the DocStatus.
    C = Closed and O = Open
    You could add another where clause:
    where t0.DocStatus = 'c'
    to the last query you added (the one referring to the ORDR table).
    Please, let me know if this helps you.
    Marcella Rivi
    SAP Business One Forums Team

  • How do you select a clob column in an SQL query report?

    I must be missing something fundamental as there is practically no help on this on the forum.
    All I want to do is ...
    select numcol,aclob_col from table
    in an SQL Query report.
    Sounds easy??? I get no data appearing in the clob column. Doesn't work in SQL Workshop either. What's the catch??
    regards
    Paul P

    Paul,
    It works when I try it. What version of Application Express, what is the table DDL, the exact query, and how much data is in the clob columns?
    Scott

  • SQL Query Report (Customize link)

    I have an SQL query report with bind variables so that users can choose conditions for the query. If I don't have any conditions, the report is empty. How do I get it to display all the records. I tried typing * but it didn't work.
    Basically I want it to act like the Query Wizard's Customize feature. The report give me all the records. I can query one field or all the fields.
    In the SQL report's Customize feature, I have to enter a value for all the bind variables I have. What if I just want to query one field. What do I put in the others to indicate that I want all. I hope this makes some sort of sense and that someone out there knows what I'm blabbing about.

    Hi,
    I h've same type of requirement in most of my reports in the application and I h've solved this in the sql of the report itself. Let's see a example report from the table scott.emp with a sql like
    Select EMPNO,
    ENAME,
    JOB,
    MGR,
    HIREDATE,
    SAL,
    DEPTNO
    From scott.emp
    Where EMPNO = nvl(:v_empno,EMPNO)
    and DEPTNO = nvl(:v_deptno,DEPTNO)
    where :v_empno and :v_deptno are bind variables to this report and if there is no arguements passed to these arguements all the records will be retrieved from the table ..likeley if value for any one of these arguements is passed then this sql will return only those records which meet that condition.
    Hope this helps
    -Krishnamurthy

  • Performance issue - insert records from db2 tables

    I have a table say emp in oracle database and i have the emp table in db2 database. My job is to pull all the records (million records) from db2 table to oracle emp table. My insert statement is like below. I am connecting to the db2 database using dblink.
    insert into emp
    select * from emp_db2, dept_db2
    where emp_db2.dno = dept_db2.dno
    and dept_db2.dno = 10;
    The statement is still running. How to improve the performance ?
    please suggest.
    thanks,
    Vinodh

    Vinodh2 wrote:
    1.how much is your select query is taking? 1 day over . still running.
    2.What is the row count from the query? 85632978 records
    3.Whats your expected completion time? 30 minutes
    I am not getting the explain plan because the query is still running.
    do as below
    SQL> set autotrace traceonly explain
    SQL> select sysdate from dual;
    Execution Plan
    Plan hash value: 1388734953
    | Id  | Operation      | Name | Rows     | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |     |     1 |     2   (0)| 00:00:01 |
    |   1 |  FAST DUAL      |     |     1 |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------

  • SQL Query report region that only queries on first load

    Hello all,
    Is there any way in which you can prevent a SQL Query report region from quering data after every refresh?
    I would like to make a report that queries on the first load, but then I would like to change the individual values, and reload to show the change, but every time I reload the page the columns are queried and the original values are displayed once again...
    any ideas?
    -Mux

    Chet,
    I created a header process to create the HTMLDB_COLLECTION. It is something like:
    HTMLDB_COLLECTION.CREATE_COLLECTION_FROM_QUERY(
    p_collection_name => 'Course_Data',
    p_query => 'SELECT DISTINCT COURSE_ID, HTMLDB_ITEM.CHECKBOX(14,COURSE_ID) as "checker", TITLE, SUBJECT, COURSE_NUMB, SECTION, ENROLLED, null as "temp_term", null as "temp_title", null as "temp_crse_id", null as "temp_subj", null as "temp_crse_numb", null as "temp_sect", FROM DB_TBL_A, DB_TBL_B, DB_TBL_C, DB_TBL_D, DB_TBL_E, DB_TBL_F WHERE ...');
    The names were changed, for obvious reasons.
    I then created an SQL Report Region to see if it would work. The SQL is:
    SELECT c001, c002, c003
    FROM htmldb_collections
    WHERE collection_name = 'COURSE_DATA'
    When I run the page it says:
    ORA-20104: create_collection_from_query Error:ORA-20104: create_collection_from_query ExecErr:ORA-01008: not all variables bound
    Any idea why this is happening?
    I'm new to HTMLDB_COLLECTIONS, so I may be doing something wrong
    -Mux

  • Setting a Default Value in SQL Query Report

    Hello:
    We are using a SQL Query Report to provide a mass update to a table. We are using the apex.collection and having it display a number of records in a SQL Query Report for mass update. We have 14 columns in the report, for which the first 11 are populated via the collection. The remaining 3 are open for input but the individual making the updates. We've were able to provide a default value for 2 of the remaining 3 columns using a named LOV's - however the fourth column we would like to default a sysdate - but we are not successful.
    We've attempted many things but none seem to work, including adding that column to the collection and assigning it a default sysdate value. We've also tried changing the settings in the report attributes --> Tabular Form Elements by setting the Display as to: Datepicker, Default type to PL/SQL Expression and setting the default to sysdate. We've also tried caputuring a date on the previous page and loading it onto the report page and trying to default the date column to a page item default.
    I'd appreciate any help.
    Thanks
    FYI - we are using version 3.2

    use as default
    to_char(sysdate, 'dd/mm/yyy') where the format is your application or item date format

  • Give me the sql query which calculte the table size in oracle 10g ecc 6.0

    Hi expert,
    Please  give me the sql query which calculte the table size in oracle 10g ecc 6.0.
    Regards

    Orkun Gedik wrote:
    select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
    Hi,
    This delivers possibly wrong data in MCOD installations.
    Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
    at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
    Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
    Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
    Use with
    segment_name LIKE '<TABLE_NAME>%'
    if you like to see the related indexes as well.
    For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
    might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
    Volker

  • SQL Query Report Very slow

    Hi I have a sql query report that is taking very long to render.The query on sql developer comes back in less than a second.Any ideas on what could be wrong?

    Hi
    When posting code on the forum, put {noformat}{noformat} (with the curly brackets and the word code in lowercase) above and below your code like this...
    {noformat}{noformat}
    SELECT *
    FROM emp
    {noformat}{noformat}
    It will then appear like this, preserving formatting...SELECT *
    FROM emp
    Next, how many rows are returned in total, it may be that you have SQL Developer set up to fetch only the first x number of rows?
    Why have you put a CHOOSE hint in there?
    Is it a classic report or an interactive report?
    It looks like you're going over a database link, you really need to provide an explain plan (formatted as I have detailed above), a DRIVING_SITE hint may help you but it's impossible to know without seeing the plan...
    Cheers
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Apex - SQL query report.

    Hi,
    Apex - 4.0 and Oracle -11g
    I m having a SQL Query report.
    Query
    SELECT htmldb_item.hidden(1,id) id,
      htmldb_item.select_list_from_query_xl(2,name,'SELECT name ,                                                              
    deptid                                                     
    FROM  emp                                                     
    WHERE name like ''E%''') name,
      htmldb_item.select_list_from_query_xl(3,deptname,'SELECT  deptname from dept where deptid =   ???') deptname
    FROM tabel
    My problem, in the report when the Select list for 'name' has been choosen , then it should retrieve the deptname based on the 'name'.
    Is it possible ?

    you want  select list value should affected in SQL report? i mean redirect and set value to SQL report?

  • How to generate report from two tables using DAO design pattern?

    Hi,
    Iam using struts with DAO pattern for my application. According to DAO design im creating model class for each table in my database with getter,setter methods. i have no problem when im generating report from one table. but if have i have to join two tables whatis the better way for doing that? is it good practise to create a new model contains properties from both the tables?
    Please help me
    Thanks in Advance
    Rajesh

    Dear Rajesh,
    As per the pattern you are creating equivalent java objects for every database table under consideration in which each db field will become a private attribute and public getter and setter methods.
    If you have to display data from one table the above approach is sufficient enough.
    But in case your database is normalised ..lets take an example of Bank having Branch and Accounts tables. We dont need to repeat the whole information of the branch for every account in that branch. so we prefer to have a branch id in that table....this approach lot of insertion/deletion/updatation anomlies that may exists with the database...
    now lets come back to our topic....we shall create two java objects 1) Branch 2) Account.....
    When ever u just need to display simple report u can do it staright forward,,,,,now if u want to display branch information along with the account information....the two objects just created are not sufficient
    So i suggest u the following approaches
    1) Create an attribute of type Branch in the Accounts Object......
    This shall serve the purpose of displaying the Btranch information
    2) Create a collection object of type ( Vector or ArrayList) which can have objects of Account in the Branch Object,,,
    Now its upto u how shall u fill up the objects with appropriate sql queries.
    The method that i mentioned is followed by Oracle Toplink and Hibernate ....which provide Object to relation mapping layers.
    Any queries ...revert back to me...
    Mahesh

  • Fail to create SQL query report because of ORA-00923

    Hi expert,
    I would like to SQL query report using the following query:
    select min(identified_date) first_identified,
    max(actual_COMPLETE) last_closed,
    count(id) total_issues,
    sum(decode(status,'Open',1,0)) open_issues,
    sum(decode(status,'Pending',1,0)) pending_issues,
    sum(decode(status,'Resolved',1,0)) closed_issues,
    sum(decode(status,'Will Not Resolve',1,0)) not_resolve_issues,
    sum(decode(status,
    'Open',decode(priority,null,1,0),
    0)) open_no_prior,
    sum(decode(status,
    'Open',decode(priority,1,1,0),
    0)) open_prior_1,
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2
    sum(decode(status,
    'Open',decode(priority,3,1,0),
    0)) open_prior_3,
    sum(decode(status,
    'Open',decode(priority,'4',1,0),
    0)) open_prior_4,
    sum(decode(status,
    'Open',decode(priority,5,1,0),
    0)) open_prior_5
    from SOFTPROJ_issues
    where project_id = :P83_PROJECT
    However, I got the following error during the steps of creation:
    1 error has occurred
    Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿)
    I wonder why if it is getting the error because I could create the report with the following query without problems:
    select min(identified_date) first_identified,
    max(actual_COMPLETE) last_closed,
    count(id) total_issues,
    sum(decode(status,'Open',1,0)) open_issues,
    sum(decode(status,'Pending',1,0)) pending_issues,
    sum(decode(status,'Resolved',1,0)) closed_issues,
    sum(decode(status,'Will Not Resolve',1,0)) not_resolve_issues,
    sum(decode(status,
    'Open',decode(priority,null,1,0),
    0)) open_no_prior,
    sum(decode(status,
    'Open',decode(priority,1,1,0),
    0)) open_prior_1,
    sum(decode(status,
    'Open',decode(priority,3,1,0),
    0)) open_prior_3,
    sum(decode(status,
    'Open',decode(priority,5,1,0),
    0)) open_prior_5
    from SOFTPROJ_issues
    where project_id = :P83_PROJECT
    1 error has occurred
    Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿)
    The difference is to add the followings only:
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2
    sum(decode(status,
    'Open',decode(priority,'4',1,0),
    0)) open_prior_4,
    Does anyone have any idea to resolve the issue?
    Thanks in advance,
    Rui

    By putting a comma after open_prior_2:
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2,Sima

  • App-V Reporting: SQL query for Excel Pivot Table to display App Usage (H/M/S)

    I recently posted this in the Gallery.  If anyone has any modifications or enhancements please feel free to contribute!  One thing that I'd like to be able to add to it is the ability to only display information for applications/packages that are
    still published, so if anyone can figure out a crafty way to do it...  Thanks!
    http://gallery.technet.microsoft.com/App-V-Reporting-SQL-query-6695d3c3

    I recently posted this in the Gallery.  If anyone has any modifications or enhancements please feel free to contribute!  One thing that I'd like to be able to add to it is the ability to only display information for applications/packages that are
    still published, so if anyone can figure out a crafty way to do it...  Thanks!
    http://gallery.technet.microsoft.com/App-V-Reporting-SQL-query-6695d3c3

  • Displaying a radio group in SQL QUERY report region

    Good morning everyone,
    I have a report in which a column - ORDER STATUS, will come in with a value of 1, 2 or 3...being order unfilled, order partially filled, or order filled, respectively.
    I would like to display the order status as a radio group on the report so that it will be easy to run down the column of radio buttons to see what is filled, etc.
    I've gone to the manual and checked the doco on HTMLDB_ITEM.RADIOGROUP. But the example given there is actually for CHECKBOX (is this an error?!?).
    I went to the forums and found nothing suitable.
    My region is an SQL QUERY. Can I display the STATUS as a radio group in the SELECT ?
    This is the question.
    Thankyou in anticipation. TC. 23/11/2004

    Tony,
    There may be better solutions, but here's what I was thinking:    create table orders (id number, status number, customer varchar(30))
        insert into orders (id,status,customer) values(1,1,'ACME')
        insert into orders (id,status,customer) values(2,2,'BENSON')
        insert into orders (id,status,customer) values(3,3,'CLARKE')
        commit
        Query Source
        select
          id "ORDER NUMBER",
          decode(status,
            1,htmldb_item.RADIOGROUP(1,status,'1','unfilled')||htmldb_item.RADIOGROUP(2,status,'2','partial','"disabled=true"')||htmldb_item.RADIOGROUP(3,status,'3','filled','"disabled=true"'),
            2,htmldb_item.RADIOGROUP(1,status,'1','unfilled','"disabled=true"')||htmldb_item.RADIOGROUP(2,status,'2','partial')||htmldb_item.RADIOGROUP(3,status,'3','filled','"disabled=true"'),
            3,htmldb_item.RADIOGROUP(1,status,'1','unfilled','"disabled=true"')||htmldb_item.RADIOGROUP(2,status,'2','partial','"disabled=true"')||htmldb_item.RADIOGROUP(3,status,'3','filled'))
          "STATUS",
          customer "Customer Name"
        from orders;Scott

  • Store SQL query results in db table

    Hi,
    I have a SQL query that produces a report table.
    Is it possible to automatically store the query results (or the report table) as a db table - without interrupting the current report building proces?
    Thanks,
    Dave
    Message was edited by:
    Dave Judge

    Hi Dave,
    You can also insert records into an existing table:
    INSERT INTO TABLEB (colA, colB, colC, etc) SELECT valA, valB, valC, etc FROM VIEWA WHERE etc etc
    This can be done during a page process that runs "Before Header" and you can base your report on the TABLEB. Obviously, you will need to maintain that table to ensure that it is only truncated where necessary, that one user doesn't try to access another user's data on that table and that each time your page is loaded it doesn't try to repopulate the table when you don't need it to.
    Another possiblity is to use a collection - which is user session based
    Andy

Maybe you are looking for

  • Creation of new COPA by copying previous Company code config

    Hi Guys: We have copied new COPA configuration for new company code with reference to already existing company code's config. I could not able to see Actual Flow of values by comparing different screens between old and new config. New config is not h

  • Ios7 Remote App no landscape on Ipads

    Since upgrading to ios7, the Apple Remote App is persistantly in portrait mode.  Anyone else notice that they can't operate the Remote App on an ipad in landscape?  Sort of a problem on a horizontally wall-mounted Ipad.

  • What is the latest version of EJB ?

    a) what is the latest version of EJB ? and b) what was the version prior to the latest version ? Any good book suggestion for option - b

  • ATI Radeon 2600 XT on Mac Pro 2008 has died

    Hi All, I have recently been having issues with one of my ATI Radeon 2600 XT Graphics cards - choppy graphics, artefacts appearing on the display and endless crashes of the OS. I have read online about a recall program Apple did run which recalled th

  • Problem with gift card

    I checked the value of a gift card and it asked me to redeem.  I did so, and now show $10 credit to my acct.  But when I go to purchase a $9.99 album, it goes directly to my CC info, and the "Redeem gift card" section at checkout says my card has alr