Question about suming two columns from different tables in Subquery?

Hello everyone,
I have a subquery that works great for getting the total SUM of a Billing table, but I also need to add to that SUM the total surcharges or additional charges from a separate table.  I tried this by doing something like so:
(SELECT SUM(SUM(Amount) FROM Billing WHERE Billing.JobID = Jobs.ID AND Billing.BillingType = 'Invoice' AND Billing.InvoiceCanceled = 'No', SUM(Payment) FROM Payments WHERE Payments.JobID = Jobs.ID AND Payments.Type = 'Bill')) as [Amount],
But it doesn't work as there is an incorrect syntax near 'FROM'.  I'm assuming this is because of the two FROM's in the Subquery?  But I am not sure how else I would be able to do this then?  
Any help would be greatly appreciated.  I just noticed this bug and am hoping to get a fix out as quickly as possible.
Thanks Again,

Hi, sorry for taking so long to get back to this post. 
I tried this example like so:
(SELECT SUM(A1) AS Total1, SUM(A2) AS Total2
FROM
(SELECT
(SELECT SUM(Amount) FROM Billing WHERE Billing.JobID = Jobs.ID AND Billing.BillingType = 'Invoice' AND Billing.InvoiceCanceled = 'No') AS A1,
(SELECT SUM(Payment) FROM Payments WHERE Payments.JobID = Jobs.ID AND Payments.Type = 'Bill') AS A2),
However, get an error that an Incorrect Syntax exists near the ','.  I remove the comma (Which I think should be there), and I get an error that an Incorrect Syntax exists near the '.'...
I also tried doing it like this (Based on other suggestions I've found online:
(SELECT SUM(SELECT SUM(Amount) FROM Billing WHERE Billing.JobID = Jobs.ID AND Billing.BillingType = 'Invoice' AND Billing.InvoiceCanceled = 'No') as [Amount],
(SELECT SUM(Payment) FROM Payments WHERE Payments.JobID = Jobs.ID AND Payments.Type = 'Bill') as [Additional]),
And I get an error that an Incorrect Syntax exists near 'SELECT'...
I also tried doing something like this with the SQL I already had...
(SELECT SUM(Amount) FROM Billing WHERE Billing.JobID = Jobs.ID AND Billing.BillingType = 'Invoice' AND Billing.InvoiceCanceled = 'No') as [BilledAmount],
(SELECT SUM(Payment) FROM Payments WHERE Payments.JobID = Jobs.ID AND Payments.Type = 'Bill') as [Additional],
SUM(BilledAmount + Additional) AS [TotalBilled],
But I get an error that the alias' are Invalid Column Names...  I have used Alias' before so I'm not sure why this would be an issue here...
As you can see, I've been trying to figure this issue out, but haven't had much luck...  :(

Similar Messages

  • How to update multiple columns from different tables using cursor.

    Hi,
    i have two tables test1 and test2. i want to udpate the column(DEPT_DSCR) of both the tables TEST1 and TEST2 using select for update and current of...using cursor.
    I have a code written as follows :
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
         LOOP
              FETCH C1 INTO v_mydept1,v_mydept2;
              EXIT WHEN C1%NOTFOUND;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
         END LOOP;
         COMMIT;
    END;
    The above code when run says that it runs successfully. But it does not updates the desired columns[DEPT_DSCR].
    It only works when we want to update single or multiple columns of same table...i.e. by providing these columns after "FOR UPDATE OF"
    I am not sure what is the exact problem when we want to update multiple columns of different tables.
    Can anyone help me on this ?

    oops my mistake.....typo mistake...it should have been as follows --
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    Now here is the upated PL/SQL code where we are trying to update columns of different tables --
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 INTO v_mydept1,v_mydept2;
    EXIT WHEN C1%NOTFOUND;
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    END LOOP;
    COMMIT;
    END;
    Please let us know why it is not updating by using using CURRENT OF

  • Create ViewCriteria comparing two columns from same table

    Does anyone know how I can create a ViewCriteria where clause that compares two columns from the same table?
    For example if I had two integer columns (MINSAL and MAXSAL) and wanted to see if they are equal. I would normally do the following SQL below.
    SELECT * FROM EMPL
    WHERE MINSAL = MAXSAL

    It works, but it is not ideal.
    Setup a Transient column that performs a groovy evaluation of MINSAL=MAXSAL and then my ViewCriteria evaluates the column to true and I set Query Execution Mode to Both.

  • Columns from different tables displayed in an ADF table format

    I have a many to one relationship between 2 tables (checklist -> subcontract). I would like to display columns from each table on a web page in an ADF Read Only Table format. I created a method that returns the data I need from the tables. When I drag that method over to my page JDev I'm only allowed to select columns from either the checklist table OR the subcontract table. I need one column from the subcontract table and several columns from the checklist table. I'm using JDev 10.1.3.2 and an Oracle 11g database. Thank you in advance.
    -Wade

    Thank you for your response. I ended up creating a new getter in the Checklist table which refers to the column in the Subcontract table. Then I was able to create a table column for that returned value.
    Thanks again!
    -W

  • Comparing two records from different tables error.

    Hi folks!
    I have this PL/SQL Block.
    I want to compare the only one record from both tables to see if the content of them are equal or not, but I don't want to specified column by column to do that.
    Any idea?
    Thanks a lot in advanced,
    Abdel E. Miranda S.
    Panama
    declare
    cursor c_aems_prueba is
    select nombre, direccion, telefono, limite, seq
         from aems_prueba;
    cursor c_aems_testing is
    select nombre, direccion, telefono, limite, seq
         from aems_testing;
    vc_aems_prueba c_aems_prueba%rowtype;
    vc_aems_testing c_aems_testing%rowtype;
    vt_aems_prueba aems_prueba%rowtype;
    vt_aems_testing aems_testing%rowtype;
    begin
    insert into aems_prueba
    values('ABDEL MIRANDA', 'PAITILLA', '215-3411', 1000, 1);
    insert into aems_testing
    values('ABDEL MIRANDA', 'PAITILLA', '215-3411', 1000, 1);
    commit;
    open c_aems_prueba;
    fetch c_aems_prueba into vt_aems_prueba;
    open c_aems_prueba;
    fetch c_aems_prueba into vt_aems_testing;
    if vt_aems_prueba = vt_aems_prueba
    then
         dbms_output.put_line('son iguales las variables, si funciona la comparacion de dos estructuras');
         else
         dbms_output.put_line('no son iguales las variables, no funciona la comparacion de dos estructuras');
    end if;
    close c_aems_prueba;
    close c_aems_testing;
    end;

    Satyaki De,
    Java is involving because an Outsourcing new project. The outsourcing company is developing the new application using JSF which invoke an interface java method [depending of the operation: select, update, insert] and them invoke the PLSQL API to precess tha operation.
    In the case I already wrote here, the issue is this:
    The user search for a specific data using the interface. The java method send a request for these operation through the API. the PLSQL process the request and return a beam, with all the column the user look for.
    The user see the information in the application windows. Assuming the user wants to change some data, he modify just one field [lets say telephone number] and press the update button. The application process the request using a different method, which invoke a different function within the PLSQL API.
    Once the information is returning to the API, I must know if at least one field change its value. So I was thinking to get the beam with the data before it was changed and compare it with the beam with the changing data.
    If current_beam = new_beam
    then
    update
    else
    no change to process
    end if;
    Any idea.

  • Copying column from different table

    I want to copy the column of one table1 to table2 column with the condition to add the existing data not to replace
    Regards

    Sure ->
    satyaki>>
    satyaki>> CREATE TABLE emp_source
      2  AS
      3     SELECT * FROM emp;
    Table created.
    satyaki>>
    satyaki>> SELECT COUNT(*) FROM emp_source;
      COUNT(*)
            14
    satyaki>>
    satyaki>> CREATE TABLE emp_target
      2  AS
      3     SELECT * FROM emp WHERE ROWNUM <= 8;
    Table created.
    satyaki>>
    satyaki>> SELECT COUNT(*) FROM emp_target;
      COUNT(*)
             8
    satyaki>>
    satyaki>> BEGIN
      2     MERGE INTO emp_target et
      3        USING ( SELECT * FROM emp_source ) es
      4        ON    ( et.empno = es.empno )
      5     WHEN MATCHED THEN
      6     UPDATE
      7        SET et.ename  = es.ename
      8        ,   et.sal    = es.sal
      9        ,   et.mgr    = es.mgr
    10        ,   et.deptno = es.deptno
    11     WHEN NOT MATCHED THEN
    12     INSERT
    13        ( et.empno, et.ename, et.sal, et.mgr, et.deptno )
    14        VALUES
    15        ( es.empno, es.ename, es.sal, es.mgr, es.deptno );
    16 
    17     DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows merged.');
    18  END;
    19  /
    14 rows merged.
    PL/SQL procedure successfully completed.Hope this will help.
    Regards.
    Satyaki De.

  • Matrix with Info Columns from different Table

    Hi, how can i manage to have a column in a matrix that doesn't represent a value of the table the other columns are using?
    For example, i have a matrix and this matrix has values of the UDT (@Table) and one column contains the projectcode. now i want one column in my matrix to show the project name of the OPRJ. how can i manage that, so that the value of this column in the matrix changes when i change the value of the other column with the project code?
    best regards
    Philipp

    Hi
    1) You can fill the matrix from Recordset.
    For example: UDT is [@O01_USERTABLE].
    PrjCode foreign key to the Projects table (OPRJ - not exposed through the DI API).
    So, if you type correctly PrjCode, you can fetch description using method below.
    Dim sSql As String = ""
    sSql = " SELECT U.PrjCode AS PrjCode, S.PrjName As PrjName" & _
               " FROM [@O01_USERTABLE] AS U, OPRJ AS S" & _
               " WHERE U.PrjCode = S.PrjCode"
    oRS = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    oRS.DoQuery(sSql)
    If oRS.RecordCount > 0 Then
      Dim i As Integer = 0
      oRS.MoveFirst()
      While oRS.EoF = False
        i = i + 1
        oForm.DataSources.UserDataSources.Item("uNr").Value = i     ' 1" matrix column for row number
        oForm.DataSources.UserDataSources.Item("uPrjCode").Value = oRS.Fields.Item("PrjCode").Value
        oForm.DataSources.UserDataSources.Item("uPrjName").Value = oRS.Fields.Item("PrjName").Value
        oMatrix.AddRow()
        oRS.MoveNext()
      End While
    End If
    2) On ManageDataEvent, call Matrix_FetchDescriptions(...)
    Public Sub ManageDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean)
      Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.Item(BusinessObjectInfo.FormUID)
      If BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD Then
        If Not BusinessObjectInfo.BeforeAction Then
          Try
           oForm.Freeze(True)
         Dim oMatrix As SAPbouiCOM.Matrix
         oMatrix = oForm.Items.Item("mtx00").Specific
         If oMatrix.RowCount > 0 Then
           Call Matrix_FetchDescriptions(oForm, -1)
         End If
          Catch ex As Exception
          Finally
         oForm.Freeze(False)
         oForm.Update()
          End Try
        End If
      End If
      oForm = Nothing
    End Sub
    ' Update column Name
    Private Sub Matrix_FetchDescriptions(ByRef oForm As SAPbouiCOM.Form, ByVal iRow As Integer)
      Dim oMatrix As SAPbouiCOM.Matrix
      Dim oColumn As SAPbouiCOM.Column
      Dim oCell As SAPbouiCOM.Cell
      Dim oEdit As SAPbouiCOM.EditText
      Try
        If SBO_Company.Connect Then
         oMatrix = oForm.Items.Item("mtx00").Specific
         If oMatrix Is Nothing Then Throw New Exception("ERROR: matrix object is nothing")
         Dim iNrRows As Integer = oMatrix.RowCount ' iRow
         If iNrRows > 0 Then
           Dim i As Integer = 1
           For i = 1 To iNrRows
             Dim sCode As String = ""
             Dim sName As String = ""
             Try
                  ' Matrix column PrjCode
               oColumn = oMatrix.Columns.Item("ePrjCode")
               oCell = oColumn.Cells.Item(i)
               oEdit = oCell.Specific
               sCode = oEdit.Value
               sName = GetNameByCode(sCode)
               If Not sName.Equals("") Then
                     ' Matrix column PrjName
                oColumn = oMatrix.Columns.Item("ePrjName")
                oCell = oColumn.Cells.Item(i)
                oEdit = oCell.Specific
                oEdit.Value = sName
               End If
               If iRow = i Then Exit Sub
             Catch ex As Exception
             Finally
             End Try
           Next
           oForm.Refresh()
         End If
        End If
      Catch ex As Exception
        ' log exception
      Finally
        oMatrix = Nothing
        oColumn = Nothing
        oCell = Nothing
        oEdit = Nothing
        System.GC.Collect() 'Release the handle to the table
      End Try
    End Sub
    To get Name using Code...
    Private Function GetNameByCode(ByVal sCode As String) As String
      If sCode.Trim.Equals("") Then Return ""
      Dim sName As String = ""
      Dim oRS As SAPbobsCOM.Recordset
      Try
        oRS = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
        Dim sSql As String = "SELECT PrjName FROM OPRJ WHERE PrjCode = '" & sCode.Trim & "'"
        oRS.DoQuery(sSql)
        oRS.MoveFirst()
        While oRS.EoF = False
          sName = oRS.Fields.Item("PrjName").Value()
          Exit While
        End While
      Catch ex As Exception
      Finally
        If Not oRS Is Nothing Then
          System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS)
          oRS = Nothing
        End If
      End Try
      Return sName
    End Function
    Note: Matrix_FetchDescriptions() have second argument (iRow As Integer) what may be used to indicate in what row you need to update PrjName column.
    May be ItemManagment event when item pressed can be used... Try
    HTH
    BR
    Sierdna S.

  • Question about tunnel two WLAN from the same foreign WLC to the same anchor

    Hi all,I met following customer request:
    one anchor WLC 4402-12 put in the DMZ of perimeter firewall, one WiSM in the internal network to controll all the AP1252. two WLAN created at the WiSM and anchor WLC: guest wlan(web-auth+lobby admin created guest accounts) and untrusted wlan(web-auth+ACS+AD user database). Both WLANs want to be tunneled from WiSM to Anchor WLC. Guest WLAN has not much users, untrusted WLAN has a lot of users which may be thousands. My question is if this design can work?(I know definately one WLAN can be tunneled, but not sure if there's any potential issues if tunnel two WLANs)
    Is there any performance issue? What WLC version is suggested to use?
    Thanks for any help!

    I haven't ever tried this but suspect that you can form only one tunnel outbound per WLC. The anchor supports multiple inbound tunnels but outbound is the question. When you find out for sure please post it here.

  • Select column 1 into two column from same table

    Dear Sir
    I have a data like
    studid makr tottal credit total average mark semester
    251; 249.84; 41; 6.09; 1
    106; 285.32; 42; 6.79; 1
    285; 263.88; 38; 6.94; 1
    251; 202.40; 28; 7.23; 2
    106; 293.20; 39; 7.52; 2
    285; 228.14; 39; 5.85; 2
    I want to select average mark semester1 and semester 2 in different column
    studid   average_mark_  semester1 average_ mark_ semester_ 2
    251 6.09 7.23
    106 6.79 7.52
    285 6.94 5.85
    please help me
    regards
    sanat kumar
    thanks in advance

    Dear Sir,
    Thank u for your prompt answer.
    But I want to select student id and average mark based on semester
    out put supposed to be
    student id average_makr_sem1 average_mark_sem2
    251     6.09     7.23
    106     6.79     7.52
    285     6.94     5.85
    I want to select the average mark in different column based on semester
    Please look into
    thanks
    regards
    sanat

  • Can I do an Insert using two selects from different tables?

    Hi,
    I have three tables, Course (CID, NAME, TIME)
    Teacher (TID, NAME, DESCRIPTION) and OfferedBy(CID, TID) to match a course to a teacher.
    After I do an insert on Course, I want to be able to do an insert on OfferedBy using the CID of the course I inserted, and the TID of the teacher that's offering it.
    I tried this after doing inserts on Course and Teacher:
    INSERT INTO OfferedBy values (SELECT CID FROM Course where courseName = 'name' , SELECT TID FROM Teacher WHERE LastName = 'teacherName').
    I get an ORA 00907 error.
    What am I doing wrong? Can this actually be done?
    Thank you
    I

    Hi,
    How would you relate the TID with CID?
    I tried this after doing inserts on Course and Teacher:
    INSERT INTO OfferedBy values (SELECT CID FROM Course where courseName >= 'name' , SELECT TID FROM Teacher WHERE LastName = 'teacherName').
    I get an ORA 00907 error.You can use the query in this way:
    SQL> SELECT ( ( SELECT dummy FROM DUAL), (SELECT DUMMY FROM DUAL)) FROM DUAL;
    SELECT ( ( SELECT dummy FROM DUAL), (SELECT DUMMY FROM DUAL)) FROM DUAL
    ERROR at line 1:
    ORA-00907: missing right parenthesis
    SQL> SELECT 'AA',(SELECT dummy FROM DUAL) FROM DUAL;
    'A (
    AA X
    SQL>Regards

  • I got a question about search help comes from check table

    But it dosen't work because it always have its value from the  first criteria.
    And I don't want no values be added into the criteria.
    How can I solve this problem.

    Seems like an interview question, if not tell us the purpose and scenario you are working on.
    Regards
    Karthik D

  • Problem about mapping 1 column with different tables..

    Hi,
    I have 3 Tables (I will give examples not exact tables but same structure and logic)
    Cars :
       ID  ( Car ID)
       Name
    Planes :
       ID ( Plane ID)
       Name
    Processes :
       ID ( Process ID )
       Type
       VehicleID {code}*Sample Processes Table Data*
    {code:java}ID     Type      VehicleID
    1          1               1       
    2          1               2
    3          2               1
    3          2               2{code}
    When type is *1*, This is *Car* and means that *VehicleID* maps to *Cars Table*,
    When type is *2*, This is *Plane* and means that *VehicleID* maps to *Planes Table*.
    And So On 3, 4, 5, 6 .. for Additional tables.
    How can i map something like that? I can not merge these tables, they all must be separated..
    I used to handle this by writing native SQL with some functions, however with JPA i could not figure it out..
    Thanks again
    Regards.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I do not know an easy way to do this in pure JPA. EclipseLink though is able to do this using a variable one to one mapping:
    http://wiki.eclipse.org/Introduction_to_Relational_Mappings_%28ELUG%29#Variable_One-to-One_Mapping
    This can be set using a customizer or JPA like annotations:
    @VariableOneToOne(
    targetInterface=Vehicle.class,
    cascade=PERSIST,
    fetch=LAZY,
    discriminatorColumn=@DiscriminatorColumn(name="TYPE", discriminatorType=INTEGER),
    discriminatorClasses={
    @DiscriminatorClass(discriminator="1", value=Cars.class),
    @DiscriminatorClass(discriminator="2", value=Planes.class)
    Best Regards,
    Chris

  • How to get only column names from different tables as single table columns

    Hi All,
       I have one requirement in which we want only column names from different tables.
    for example :
     I have three tables T1 ,T2, T3 having
      col1 clo2 clo3 -->  T1 , 
      col3 col5 ,clo6 --> T2 ,
      Clo6 col8 col9 --> T3
    columns i want to get only all  Column names from all table as single Resultset not any data from that how can i get that empty resultset 
    because this empty result i want to bind in datagridview(front end) as Empty resultset 
    Please tell me anyways to do this
    Niraj Sevalkar

    If I understand you want an empty result set, just with metadata. SET FMTONLY do the trick:
    SET FMTONLY ON
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    SET FMTONLY OFF
    Another alternative is to include an imposible contition
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    WHERE 1 = 0
    If you are using a SqlDataAdapter in your client application. You can use the FillSchema method. the select command may be any select statement that returns the columns you want. Under the covers FillSchema will call SET FMTONLY ON.
    If you are using SqlCommand.ExecuteReader you can pass SchemaOnly to CommandBehavior argument. SET FMTONLY ON is called under the covers. Again the select command may be any select statement that returns the columns you want.
    "No darás tropezón ni desatino que no te haga adelantar camino" Bernardo Balbuena

  • SUM two fileds from different rows from the same table

    I would like to SUM two fileds from different rows from the same table but I don't know how to do that.
    E.g.
    BillingTransactionsIndex      CreateDate      UserType      UserIndex      TransType      Reference      Total      Balance
    2      6/5/2008 15:02      1      51      1      150      -288.2      -288.2
    5      6/8/2008 11:55      1      51      1      157      -1.58674      -289.787
    In the table above I want SUM fields Total and Balance for the first row and the the next row SUM 2nd row Total with 1st row Balance
    Please help
    Thanks

    SQL> with tbl as
      2  (select 1 as ID,  90 as total from dual
      3          union all
      4  select 2 as ID,  23 as total  from dual
      5          union all
      6  select 3 as ID,  15 as total  from dual
      7          union all
      8  select 4 as ID,  20 as total  from dual)
      9  select id , total, sum(total) over (order by ID) as balance from tbl
    10  /
            ID      TOTAL    BALANCE
             1         90         90
             2         23        113
             3         15        128
             4         20        148
    SQL>

  • Report using Data from different tables

    Hello,
    I am trying to convert a Cobol batch program to Oracle 6i tabular report.
    The data is fetched from many different tables and there are lots of processing(i.e, based on the value of a column from one table need additional processing from different tables) required to generate the desired columns in the final report.
    I would like to know what is the best strategy to follow in Oracle Reports 6i. I heard that CREATE GLOBAL TEMPORARY TABLE is an option. ( or REF CURSOR ?) I do not know much about its usage. Can somebody guide me about this or any other better way to achieve the result.
    Thank you in advance
    Priya

    Hello,
    There are many, many options available to you, each of which has advantages and disadvantages. This is why it is difficult to answer "what is best?" without alot more details about your specific circumstances.
    In general, you're going to be writing PL/SQL to do any conditional logic that cannot be expressed as pure SQL. It can executed in the database, or it can executed within Reports itself. And most reports developers do some of both.
    As a general rule, you want to send only the data you need from the database to the report. This means you want to do as much filtering and aggregating of the data as is readily possible within the database. If this cannot be expressed as plain SQL queries, then you'll want to create a stored procedures to help do this work.
    Generally, the PL/SQL you create for executing within the report should be focused on control of the formatting, such as controlling whether a field is visible, or controlling display attributes for conditional formatting.
    But these are not hard and fast rules. In some cases, it is difficult to get all the stored procedures you might like installed into the database. Perhaps the dba is reluctant to let you install that many stored procedures. Perhaps there are restrictions when and how often updates can be made to stored procedures in a production database, which makes it difficult to incrementally adjust your reports based on user feedback. Or perhaps there are restrictions for how long queries are allowed to run.
    So, Reports offers lots of options and features to let you do data manipulation operations from within the report data model.
    In any case, Oracle does offer temporary table capabilities. You can populate a temp table by running stored procedures that do queries, calculations and aggregations. And you can define and initiate a dynamic query statement within the database and pass a handle to this query off to the report to execute (ref cursor).
    From the reports side, you can have as many queries as you want in the data model, arranged in any hierarchy via links. You can parameterize and change the queries dynamically using bind variables and lexicals. And you can add calculations, aggregations, and filters.
    Again, most people do data manipulation both in the database and in Reports, using the database for what it excels at, and Reports for what it excels at.
    Hope this helps.
    Regards,
    The Oracle Reports Team --skw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • How to make something like this in Edge Animate?

    Hi, I'm hoping to make something like this – https://www.youtube.com/watch?v=OJeDppEHI1g – in Edge Animate but I'm not sure where to start. I'm new to Edge but am keen to explore. Anyone have any feedback on whether: 1. It's possible, and 2. What tec

  • Importing and organizing video clips

    I have a question about iMovie. I've made a few movies with it but am no pro. I am really anal about organizing my photos, music, videos, etc. and for that I love iPhoto. If i've just taken some pictures on my digital camera but don't quite have a us

  • How do i change the generated font size in the TOC (left-hand pane)?

    I've looked in all the sections in the Settings dialog, but I don't see anything that will allow me to make the font size larger. I just want to enlarge the TOC books and page listings on the left. Please tell me that RH allows you to do something th

  • When watching on Apple TV, iTunes is playing another move.

    Whenever I watch or browse my playlists on Apple TV, iTunes react as well in making clicking noises, playing songs or playing movies. Why is this?

  • Apple mail - to windows mail

    hi, anybody know how to move emails in apple mail to windows mail? Got someone here at work that is having to do this, I have no idea how. Thanks! BCA