Matrix report from SQL

Hi,
I need generate a matrix report where row and column data will be dynamic. So, is there any way to generate this kind of report using SQL.
Column name will itself a data.
Eg.
Column Name (on top) will be the projects name lying with the filter condition
Row name (on left side) will be the user name.
Value (of the matrix report) will be the Hours entered by the user for that project.
Thanx.. Ratan

Hi Frankfurt,
Thank. I agreed with you, using any UI tool it is
easy to do. But this is the case where this work has
to be done only by back-end.
I tried to use PIVOT but I think this is not a
command of Oracle9i.
So any other idea?PIVOT is only available from 11g
You still haven't clarified if you really mean you want a dynamic number of columns or there is a fixed number of columns. If the answer is dynamic then you can only do this, to the best of my knowledge, using the technique in the link I gave. If fixed then we can work out some simpler pivot code for you (although a search for 'pivot' on this forum will show many many examples already).
;)

Similar Messages

  • Hwo to create a matrix report in sql Plus

    i want to create matrix report in SQL plus for emp table. how is it possible
    requirement is as following
    Deptno -- Clerk -- Salesman--Manager
    10----------2500---3500--------4500
    20----------2400---3400--------4400
    30----------1400---4400--------5400

    Hi,
    Do a search on this site on
    -'pivot'
    and/or:
    -'stragg'
    and/or:
    -'columns to rows'
    to get many example that will give you ideas.
    Also you forgot to mention this:
    What's the value of the job titles?
    Sum of salary of....?
    edit
    Using my data:
    MHO%xe> select deptno, job, sal from emp order by deptno
      2  /
        DEPTNO JOB              SAL
            10 MANAGER         2450
            10 PRESIDENT       5000
            10 CLERK           1300
            20 ANALYST         3000
            20 CLERK            800
            20 CLERK           1100
            20 ANALYST         3000
            20 MANAGER         2975
            30 MANAGER         2850
            30 SALESMAN        1600
            30 CLERK            950
            30 SALESMAN        1250
            30 SALESMAN        1500
            30 SALESMAN        1250
    14 rijen zijn geselecteerd.I would get:
    MHO%xe> select deptno
      2  ,      sum(decode(job,'CLERK',sal,0)) CLERK
      3  ,      sum(decode(job,'SALESMAN',sal,0)) SALESMAN
      4  ,      sum(decode(job,'MANAGER',sal,0)) MANAGER
      5  from   emp
      6  group by deptno
      7  order by deptno
      8  /
        DEPTNO      CLERK   SALESMAN    MANAGER
            10       1300          0       2450
            20       1900          0       2975
            30        950       5600       2850Edited by: hoek on Oct 17, 2009 3:19 PM

  • Query based Report (Reports From SQL Query)

    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    Can i increase a timeout of portal page, how i can do this?
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?

    Can you post the URL that is giving you the page not found error ? I am not sure if I can be of much help though.
    In order to increase your chances to get a reply you should also post your question in the Portal Forum - Oracle Application Server Portal
    Edited by: Rodolfo Ferrari on Jun 16, 2009 3:49 PM

  • Adding update and delete buttons to a  Report from SQL Query

    There is an option when creating a QBE to add update and delete
    links which i find quite useful, but this option doesn't seem to
    be possible on a Report from SQL Query. Do i need to do
    something special to add them? is the option located in a
    different place?

    Hi,
    You can only add Update ,Delete in QBE Reports,
    there is no option in Portal which can be used to
    have these buttons in the Reports from Query Wizard or
    Report from SQL Query.
    Thanks
    Vineet

  • Getting zero-sized reply error when running report from SQL query

    Hi,
    I have a Report from SQL Query in Portal. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

    Problem comes when any of the filter is applied in any one of the cases selected from the GUI.Do you mean that the problems only shows when you run the report in your browser via 9iAS?
    Which version are you using?
    Can you post the before report trigger?

  • Getting Zero Sized Reply error in report from SQL query

    Hi,
    I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

    Hi,
    I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

  • Width of field in Report From SQL Query

    I have created a report from SQL query with 15 columns being selected. However, no matter what column width and column type (pixel, char, percent) I enter in the column formatting tab of the report, I cannot get the report to format the column to the width I desire. It is always a fixed width. Does anyone have any suggestions?
    Thanks,
    Martin

    Hi,
    Char (used for ASCII format)
    Displays the output in the specified number of
    characters per line. For example, if you enter 20
    in Width, the report displays 20 characters of the
    column data in each line. If the number of
    characters per line exceeds the specified
    number, the remaining characters are wrapped
    to the next line.
    Pixel
    Displays the output in the specified number of
    pixels per row. For example, if you enter 10 in
    Width, the column data displays 10 pixels of
    data per line of the displayed table.
    Percent
    Displays the output in the specified percentage
    of the table. For example, if you enter 25 in
    Width, the column data displays in 25% of the
    displayed table.
    Thanks,
    Sharmila

  • Need help in Report From SQL Query

    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    I tried also increase the page time out in httpd.conf, but no use.
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?

    user602513 wrote:
    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    I tried also increase the page time out in httpd.conf, but no use.
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?Do you get any errors or warnings or it is just the slow speed which is the issue?
    There could be a variety of reasons for the delayed processing of this report. That includes parameter settings for that page, cache settings, network configurations, etc.
    - explore best optimization for your query;
    - evaluate portal for best performance configuration; you may follow this note (Doc ID: *438794.1* ) for ideas;
    - third: for that particular page carrying that report, you can use caching wisely. browser cache is neither decent for large files, nor practical. instead, explore the page cache settings that portal provides.
    - also look for various log files (application.log and apache logs) if you are getting any warnings reflecting on some kind of processing halt.
    - and last but not the least: if you happen to bring up a portal report with more than 10000 rows for display then think about the usage of the report. Evaluate whether that report is good/useful for anything?
    HTH
    AMN

  • Can Portal Report from SQL Query use where column IN (:bind_variable)

    I would like to create a portal report from sql query with IN (:bind_variable) in the where clause. The idea is that the user would enter comma-separated or comma-quote-separated values for the bind_variable. I have tried this several ways but nothing seems to work. Can this be done?
    Trenton

    Hi,
    Which version of portal are you using. This is a bug. It has been fixed in 30984.
    Thanks,
    Sharmila

  • Report from SQL Query -Excel format only show the first page

    Hi,
    I have some Reports from SQL Query. In the display options, I choose Excel as default format. The Excel documents only show the first page. If I choose HTML as default format, it shows every rows.
    Please advise on how to have a complete Excel document as HTML format does.
    Thanks a lot.
    Lina Han

    I beleive when you export Oracle reports to Excel it is the Data that is transferred along with Column Names.
    You cannot export the variables defined on the report.
    Hence you will not be able to export the Footer to excel. (Still looking into it will let you know if i find anything interesting)
    Regards,
    Bhushan Salgar

  • Report from sql query invalid date condition

    Hi, I created a Reports From SQL Query. My sql is like
    "select column1, column2
    from myschema.tablename
    where mydate > :p_date1 and mydate < :p_date2"
    I am using portal with turkish and english option. If I pass p_date paramaters 'dd-MON-yyyy' format
    (for example p_date1 = 23-MAR-2003 p_date2 = 26-APR-2003) in english mode portlet is return correct result,
    in turkish mode 'No Row Returned'. I changed my sql statement with
    "select column1, column2
    from myschema.tablename
    where to_date(mydate,'dd/mm/yyy') > to_date(:p_date1,'dd/mm/yyy') and to_date(mydate) < to_date(:p_date2,'dd/mm/yyyy')"
    and I pass p_date parameters 'dd/mm/yyyy' format (for example p_date1 = 23/03/2003 p_date2 = 26/04/2003)
    but now turkish and english mode No row returned.
    How may I write correct sql statament. My database NLS_DATE_FORMAT=DD/MM/YYYY and NLS_LANGUAGE=TURKISH.
    thanks.

    Hi,
    Try this for turkish mode:
    Case 1: the 'mydate' column has a kind of a char data type (like char, varchar or varchar2)
    and a value like '30/03/2003'
    "select column1, column2
    from myschema.tablename
    where
    to_date(mydate,'DD/MM/YYYY') > :p_date1
    and
    to_date(mydate,'DD/MM/YYYY') < :p_date2"
    Case 2: the mydate column has a date type:
    "select column1, column2
    from myschema.tablename
    where
    mydate > :p_date1
    and
    mydate < :p_date2"
    In both cases use the following parameter values:
    p_date1 = 23/03/2003
    p_date2 = 26/04/2003
    This should work
    Thanks
    Peter

  • Integrating Reports from SQL Server Reporting Services

    Dear Experts,
    I am given the URL to a report from SQL Server Reporting Services. The URL looks like
    [http://<report_server_host>/ReportServer/Pages/ReportViewer.aspx?/<category>/<report>&<list_of_parameter_value_pairs>]
    When this URL is executed, the user will be prompted for user name and password.
    And I am given the following requirements:
    - Integrate the report into SAP NetWeaver Portal
    - The report has to be passed parameters with values generated at runtime and which must be hidden (because it is sensitive data)
    Initially, I have been working on two options:
    1. using Application Integrator (portal application: com.sap.portal.appintegrator.sap, portal component: Generic)
    2. using URL iView
    With the Application Integrator, however, I got the following error:
    The operation you are attempting on item "/" is not allowed for this item type. (rsWrongItemType)
    I cannot find the solution to this. It looks like the URL which contain "/" after "?" is not appropriate for the Application Integrator.
    So I turn my focus away from the Application Integrator, but to using the URL iView instead. And in order to hide the parameters passed, I make the following settings in the URL iView:
    Request Method = POST
    Fetch Mode = Server-Side
    But then I got the following error:
    Failed to fetch the content. The response status was 401.
    Message:
    (I have defined an HTTP system and used it in the URL iView.)
    Does anyone know how to fix the errors (either with the Application Integrator or the URL iView)?
    Your answers will be much appreciated!
    Regards
    Sakprasat Sum

    Hi
    Was a solution for this found?
    I am trying to achieve the same thing, create an iView that links to an existing SQL Reporting Services report.
    Cheers,
    Andrew

  • Can I declare variables in Reports from SQL Query

    Hi
    I have a Report from SQL Query published as a portlet on a page among other reports. In the query report I am using the fuction WWCTX_API.GET_USER at quite a few places to filter the data returned to the user. Can I assingn the user id to a variable at some level & replace the fuction WWCTX_API.GET_USER with the variable in all the places.
    For eg:
    usr varchar2(25);
    usr:= PORTAL30.WWCTX_API.GET_USER;
    select USER_ID, USER_LVL, BUSINESS_ID, BRANCH_ID from crs_user where user_id=usr;
    can i declare variable and assign the value like the above at any level(Report or Page Level) to the acces the variale in queries.
    Thanks in advance

    I have found that you can't use a * in a dynamic page.
    Try this:
    <ORACLE>
    DECLARE
    usr varchar2(25):=PORTAL30.WWCTX_API.GET_USER;
    BEGIN
    for c in
    (SELECT <column_name> <alias> FROM PORTALWORK.CRS_USER WHERE USER_ID=usr)
    Loop
    htp.p(c.<alias>);
    END;
    </ORACLE>
    You can also add table tags for column formating:
    <table>
    <tr><td>column 1</td></tr><tr><td nowrap>
    <ORACLE>
    DECLARE
    usr varchar2(25):=PORTAL30.WWCTX_API.GET_USER;
    BEGIN
    for c in
    (SELECT <column_name> <alias> FROM PORTALWORK.CRS_USER WHERE USER_ID=usr)
    Loop
    htp.p(c.<alias>);
    END;
    </ORACLE>
    </td></tr></table>
    Martin

  • Customizing the HTML for a Report from SQL Query

    Hello
    I have created a Report from a SQL query that outputs a list of items from a single table column. There are 65 rows returned by the report. I would like to display all the results on one page but the length of the list prevents this. Is there any way of presenting the results as multiple columns on the same page?
    ie
    Res1 Res2 Res3
    Res4 Res5 Res6
    or
    Res1 Res3 Res5
    Res2 Res4 Res6
    I thought about using a 3 column portlet region and attempting to customise the report displayed via each of the portlets but I would prefer to avoid this as it would require the development and maintenance of an additional template.
    Thanks
    Lisa

    Problem solved...
    I have used my SQL query as a cursor in a dynamic page and then used the cursor and htp.p statements to tabulate my results as per my requirements.
    Lisa

  • Calling/starting a report from Sql Server

    Hello.
    I have to get a storage movement starting from a Sql Server Platform.
    I found out the function BAPI_GOODSMVT_CREATE which, getting the main data from an internal
    table, could create a movement in MSEG/MKPF (I suppose, I haven’t used it yet).
    But if I create a report using BAPI_GOODSMVT_CREATE which gets the data from an internal table
    (filled by a Sql Server table), how can I tell to Sap to execute it?
    Is it the only way to schedule this report in SAP every (i.e.) 5 minutes reading if there are
    data in Sql Server?
    Isn’t there a “trigger” to start a report in SAP from Sql Server/Windows?

    Hello,
    It depends on what method you use to read data i.e. Data Context class, Entity Framework for SQL-Server we can get data directly from the database easily.
    The following has two very simply examples using data context classes and the same came be done with Entity Framework which has an even more powerful version of data context implementation under 6 and above
    Dim db As New DataClasses1DataContext
    Dim theCustomer As Customer = db.Customers.Where(Function(c) c.CustomerID = 999).FirstOrDefault
    If theCustomer IsNot Nothing Then
    ' use theCustomer which contains all columns
    Else
    ' do not use, customer not located
    End If
    Dim theCustomer1 As Customer =
    From c In db.Customers
    Where c.CustomerID = 999
    Select New Customer With
    .CompanyName = c.CompanyName,
    .ContactName = c.ContactName,
    .Orders = c.Orders
    ).FirstOrDefault
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

Maybe you are looking for

  • Can I install iPhoto on an external hard drive

    My iMac is fully consumed with photos. I have no memory available. I was wondering if I purchased an external hard drive if I could completely remove iPhoto and all the pictures from my iMac and put the whole program with all the pictures on the driv

  • Need logic addition account group wise

    hi firends, i am calulating accumalated balance accumulated balance is nthing but addition of debit and credit. sum is working fine with one account group. but not for multiple aacount group. account grp   credit  debit    acc bal 17011101     100   

  • Error referencing a Struts-Form element from a JavaScript function.

    As shown below, when referencing the form element named 'custRegion', from the JavaScript function, I get an error msg - document.forms[0].custRegion has no properties. It appears that this form-element, which also is present in the logic tag is not

  • Authoring Environment - LSO

    Hello, I use the SAP Learning Solution - Authoring Environment . I have created courses are available in other tools. The course is SCORM format. Importing is not a problem. The course includes the control questions. My question is. Can I use the set

  • How do I change Apple ID on my iPhone? Need to switch I'd

    Need to switch Apple ID on my iPhone how do I do it?