Different Ouptput in SQL & Oracle Report

Hi,
I have two tables. (1) TST_P (2) CUSTOMER_LIMIT
I use one select query for this
SELECT distinct ORG_ID,CUSTOMER_ID,CUSTOMER_NAME,CUSTOMER_NUMBER,
(select distinct NVL(sum(amount_due_original),0) from TST_P WHERE CUSTOMER_ID=P.CUSTOMER_ID AND P_FLG='A') A,
(select distinct NVL(sum(amount_due_original),0) from TST_P WHERE CUSTOMER_ID=P.CUSTOMER_ID AND P_FLG='B') B,
(SELECT distinct NVL(CREDIT_LIMIT,0) FROM CUSTOMER_LIMIT WHERE DEALER_ID=P.CUSTOMER_ID ) C
from TST_P P
GROUP BY ORG_ID,CUSTOMER_ID,CUSTOMER_NAME,CUSTOMER_NUMBER
ORDER BY CUSTOMER_NAME
Now when I use this query in SQL prompt it gives perfect output.
And when i use this query in Oracle Report builder it give some duplicat records.

Denes,
I was able to get it working based on one of your examples, it gets ugly when you embed the popup javascript into the link as you know. You have some really great examples, I hadn't been to your page in awhile.
Here is my end result (this is embedded in a decode statement so single ticks would go around the entire example below)
<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:71:&SESSION.::NO:100:'
|| 'P71_EQUIPMENT_ID,P71_CONTAINER_TYPE_ID:'
|| equipment_id || ',' || '&F110_CONTAINER_TYPE_IP.'
|| ''', 900, 600);">'
|| create_date
|| '</a>
Thanks to all that helped me out here,
Justin

Similar Messages

  • SQL Server Reporting Service 2008 R2 - The request failed with HTTP status 401: Unauthorized.

    I got the error "The request failed with HTTP status 401: Unauthorized." when I call the Reporting Service Web Service.
    The code is very simple:
    // Initialise the reporting service Web Service
    this.RSWebService = new ReportingService2010();
    // Pass windos authentication credentials to Web Service
    this.RSWebService.Credentials = System.Net.CredentialCache.DefaultCredentials;
    // List children
    List<CatalogItem> reports = this.RSWebService.ListChildren(folder, false).ToList();
    The SQL Server is installed on a different machine (say server A) from the Web server (say server B). We are using Windows Server 2003.
    The code work fine for all the scenario below:
    i) Run locally (XP) to call the web service on the sql server
    ii) Provide the Network Credentials with the username, password, and domain when calling the web service
    iii) If the web server and sql server is using same server (i.e. not distributed)
    I'm using windows authentication and impersonation. Any idea?

    Hi Raymond,
    If I understand correctly, the issue only happens in the environment that the web server is different with the SQL Server Reporting Services server. This means the web server is a remote server of the Report Server. Windows Integrated authentication is used
    in this case. When running the web page, the 401 error occurs.
    If so, it is actually a double hop issue. The double-hop problem will usually only be an issue to those of you who write some sort of web-based code (a web application or web service) that uses impersonation.
    To fix the issue, we can configure kerberos authentication for the web application and the SQL Server Reporting Services.
    Below is a great article that has delivered many solutions to fix the issue you met:
    http://odetocode.com/articles/216.aspx
    Additionally, you can read the following article to know more about double-hop:
    http://blogs.technet.com/b/askds/archive/2008/06/13/understanding-kerberos-double-hop.aspx
    http://blogs.msdn.com/b/knowledgecast/archive/2007/01/31/the-double-hop-problem.aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Jin Chen
    Jin Chen - MSFT
    Thanks Jin. I believe this is the cause of the problem as well.
    I tried to register the SPN but unfortunately it still doesn't work. I'm not sure whether I'm using the correct SPN name.
    I have 3 reporting server instance on the SQL box. So the Web Service URL is like
    http://Server:80/VirtualDirectoryDev,
    http://Server:80/VirtualDirectoryTest  and
    http://Server:80/VirtualDirectoryStaging .
    What's the SPN I need to register?
    I tried
    Setspn -a http/Server:80/VirtualDirectoryDev domain\account
    and
    Setspn -a http/aerver:80 domain\account.
    But both of them are not working :(

  • Printing Oracle Reports with values obtained from file using IO

    Hi All,
    We have decided to change the report writer tool from Brio SQR to Oracle Reports 6i. The design using Brio SQR was such that we used to populate all the values to be printed in a text file and then we use to populate the values in the BRIO reports using this file as an input.
    We don't want to make many changes to the design at this stage. Can anybody suggest how can we use the text file as input to populate the different fields in the Oracle Reports.
    Thanks in advance.
    Regards,
    Milind

    Hi Miliand
    Text Datasoucre is a Reports 9i feature. You can get the information on the feature overview at
    http://otn.oracle.com/products/reports/content.html.
    You will find the complete 9I Reports reference manuals on OTN soon
    Thanks
    The Oracle Reports Team

  • Passing SQL-Parameters to Oracle-Reports from java

    hello,
    i want to write an application in the following way:
    on a java-frontend an user can select values for different
    parameters. these values should be to transferred to the sql-
    query of the reports rdf file. what is the syntax of an
    parameter passed from java to oracle reports.
    does this work with runtime.exec()... ?
    does anybody have an example.
    any help would be very appreciated.
    greetings
    Thorsten Lorenz

    In order to pass the parameters to report rdf, you can create user parameters in the oracle report builder, hook up the parameters with query. For example, you can create user parameter P_DEPTNO, then create a sql query: select * from dept where deptno = :P_DEPTNO. When you run this report, you give P_DEPTNO=10 as parameter, the rdf will generate report that only prints out department 10's information.
    Once you have this kind of report created, you have several ways to achieve what you want.
    1. use rwrun60. In your java program, you can invoke rwrun60 via runtime.exec(cmd) where cmd = rwrun60 report=dept.rdf userid=scott/tiger@orcl destype=file desformat=pdf desname=dept.pdf p_deptno=<value_from_java_app>
    2. similarly, use rwcli60. the cmd would be:
    cmd = rwcli60 server=repserver report=dept.rdf userid=scott/tiger@orcl destype=file desformat=pdf desname=dept.pdf p_deptno=<value_from_java_app>
    3. use rwcgi60. Instead of using runtime.exec, you should use java URL object to run the report in the web environment.
    option 2 & 3 takes advantage of powerful functionality of reports server, and it is much more scale than option 1.

  • Can we use Dynamic SQL in Oracle Reports ?

    Hi ,
    Can we use Dynamic SQL in Oracle Reports ?
    If yes please give some examples .
    Thanx
    srini

    I believe the built-in package SRW.Do_Sql is what you are looking for
    Example from the document:
    /* Suppose you want to create a "table of contents" by getting the
    ** first character of a columns value, and page number on which its
    ** field fires to print. Assume that you want to put the "table of
    contents"
    ** into a table named SHIP. You could write the following construct:
    DECLARE
    PAGE_NO NUMBER;
    PAGE_FOR INDEX NUMBER;
    SORT_CHAR CHAR(1);
    CMD_LINE CHAR(200);
    BEGIN
    SORT_CHAR := :SORT_NAME ;
    IF :CALLED = Y THEN
         SRW.GET_PAGE_NUM(PAGE_FOR_INDEX);
         SRW.USER_EXIT(RWECOP PAGE_FOR_INDEX
         P_START_PAGENO);
         SRW.MESSAGE(2,TO_CHAR(:P_START_PAGENO));
    END IF;
    SRW.GET_PAGE_NUM(PAGE_NO);
    CMD_LINE := INSERT INTO SHIP VALUES
                          (||SORT_CHAR||,||TO_CHAR(PAGE_NO)||);
    SRW.MESSAGE(2,CMD_LINE);
    SRW.DO_SQL(CMD_LINE);
    COMMIT;
    EXCEPTION
      WHEN DUP_VAL_ON_INDEX THEN
            NULL;
      WHEN SRW.DO_SQL_FAILURE THEN
            SRW.MESSAGE(1,FAILED TO INSERT ROW INTO SHIP TABLE);
      WHEN OTHERS THEN
           COMMIT;
    END;

  • Pl/sql vs oracle reports 6i

    Hi I am new to oracle development.
    My requirement is to create a text file periodically reading data from oracle tables.
    the client wants me to use oracle reports 6i and create a text file. they actually do not have a requirement for a report or this report will not be used in nay other way.
    the final output should be text file.
    i feel using utl_file package creating the text file on the server is a much better option. for this i thought writing a stored procedure and scheduling this procedure.
    please suggest me how i should convince. please give me suggestions in this. thanks in advance..mohan

    A while back all reports were just text files, what is the difference between a text report and a text file? If Oracle reports can do it go ahead. If you think it is overhead spool it from SQL*Plus, which as well as being an ad hoc query tool is actually designed as a text only report writer. If you want to you can still use a stored procedure that returns a ref cursor and just print and format the output in SQL*Plus however its wanted.
    Don't use util_file, its more code, slower, complicated, you can't just use SQL, you have to loop (though for some reason many programmers seem to see this as an advantage), it can only access the server, Its more suitable for diagnostics, tracing and logging, things the DBA would be interested in, not for the end user or external system interfaces.

  • Auto print Oracle report through call to PL/SQL

    I have been tasked with finding a way to generate an Oracle report from a java servlet. Basically they want to pass in parameters to a PL/SQL procedure and have it automatically print out, without user interaction.
    Can this be done?
    Jeff

    I am in a similar situation and have reached a bit of an impass. I am creating the report by means of passing a dynamically created URL from WebDB to the Report Server.
    I have created a procedure to do various things and was planning on calling the report via the procedure using
    OWA_UTIL.redirect_url depending on the params
    that the user entered. Does the UTL_HTTP work in the same means as the aforementioned? Or are they the same thing?
    Regards and thanks,
    Steve
    null

  • How to register a pl/sql report as an Oracle report.

    Guru's,
    I have a requirement to add a Pl/sql report in a shipping document set.
    Shipping document set can contain Oracle reports only(RDF).
    Is there a way we can add pl/sql report in a shipping docuemnt set?
    Thanks
    -Karthik

    Please see these docs.
    Adding PL/SQL Stored Procedure To Document Set. [ID 551154.1]
    Concurrent Programs Of Pl/Sql Attached To Shipping Document Set Is Not Firing [ID 810856.1]
    Concurrent Programs Of Pl/Sql Attached To Shipping Document Set Not Working. [ID 1246184.1]
    Shipping Document Set Containing PL/SQL Program Ends with Oracle Error 6550 in FDPSTP [ID 316221.1]
    Concurrent Program Not Being Called? [ID 956722.1]
    Thanks,
    Hussein

  • SQL Query as Item Source/Oracle Reports w/ HTML DB?

    I have successfully used a SQL Query as an item source in the past on several occasions. However, in this instance, every time I try to do this, I get the following error:
    Error ERR-1019 Error computing item default value: page=3 name=P3_TEST_ITEM.
    ORA-01460: unimplemented or unreasonable conversion requested ORA-02063: preceding line from [database_name]
    If I use the exact same query in creating a report region, the page displays fine and the query returns the correct data. Why might this be happening, and what can I do to fix it?
    Also - off the subject - is there a way to use HTML DB to deploy reports that are created in Oracle Reports Builder? I have created several employee productivity reports for supervisors and managers in HTML DB, which is great for allowing them to run them live and have fields as parameters for varying employees, date ranges, etc... but formatting them to be browser and printer friendly is an absolute nightmare so far. If I could create and format the reports in Reports Builder and then deploy them using HTML DB, while still being able to offer parameters to the user, that would be perfect. Is this possible?

    Here is my query:
    SELECT
    TO_CHAR((sum(decode(ef.production_function,'Y',ef.function_minutes+ef.function_ot_minutes))/60)/8, '9999999.99')
    FROM
    RLAPPLSG.EMPLOYEE_INFO@REMOTE_SERVER EI,
    RLAPPLSG.SC_EMP_FUNCTIONS@REMOTE_SERVER EF,
    RLAPPLSG.SC_EMP@REMOTE_SERVER E
    WHERE
    ( e.SC_EMP_NBR=ef.SC_EMP_NBR )
    AND ( ei.EMP_ID=e.EMP_ID )
    AND (
    ( trunc(( e.SC_DATE )) BETWEEN :P2_BEGIN_DATE AND :P2_END_DATE )
    AND (ei.EMP_MGRS_ID = :P2_SUPERVISOR_ID
    OR ei.EMP_ID = :P2_SUPERVISOR_ID)
    Every table and/or view that is referenced here is done so remotely. The column datatype breakdown is as follows:
    production_function - BOOLEAN
    function_minutes - NUMBER
    function_ot_minutes - NUMBER

  • Using PL/SQL in a formula column in Oracle Reports Builder.

    Hi,
    I need to SUM two record from the result of an SQL interrogation.
    Here's what it looks like
    function CF_1Formula return Number is
    nTot1 NUMBER :=0;
    nTot2 NUMBER :=0;
    begin
         select sum(:TOT1) into nTot1 from table(Q1) ;
         select sum(:TOT2) into nTot2 from table(Q1) ;
         return (nTot1 + nTot2);
    end;I'm kind of new to formula column programming any link of interest would be appreciated.
    The from table(Q1) part Q1 represents my SQL interrogation name and the group below it is G_MAIN.

    Hi Hong Kong King Kong,
    From looking at that function name (and the group name): Is this an Oracle Reports generated function?
    If so, there's also a dedicated Reports forum: Reports
    By the way, I like your synonym for 'query'.
    I'm sure I'll confuse some of my collegues tomorrow when I will mention 'database interrogation' instead of 'query'. ;)
    edit
    Doh...I should not underestimate the information that is posted in thread subjects.
    Edited by: hoek on May 5, 2010 9:24 PM

  • Adding a field to an sql statement in Oracle Reports error ORA-00933

    We have been requested to add a field that already exists in the table referred to by the sql statement in Oracle Reports Builder. The report was set up by a consultant about 3 yrs ago and we don't really have much skill in this area. What is happening when I try to modify the SQL statement, either adding a field or deleting a field to the SELECT statement, causes an error message preventing the statement from being saved. The only way out of the error message is to click Cancel. The error message is
    ORA-00933:SQL command not properly ended
    ORDER BY Program ==> NAME
    Even adding or deleting a space anywhere in the SQL statement causes the error (not adding any new fields). A coworker found that if we comment out the ORDER BY, the statement will accept the new field in the SELECT section, however then we lose the order by functionality. I would like to add one additional field before the FROM. Not sure if any additional data are needed. Thank you.
    SELECT p.person_uid PIDM_KEY, p.id_number ID,
                   p.full_name_lfmi name,            
                    p.BIRTH_DATE, p.GENDER Sex,
                    Decode(a.residency,'D',p.Primary_ethnicity,'F')  Ethn,
                    a.academic_period TERM,        
                    CASE WHEN :p_group_by = 'PROGRAM' THEN a.program
                                 ELSE ' '
                    END AS Program,
                    a.COLLEGE, a.degree, a.major, ' ' rule,
                    a.STUDENT_POPULATION,a.STUDENT_LEVEL,    a.application_status Status,  a.application_status_date app_sts_dte,
                    ad.decision_date1 Last_Dec_Date,
                    ad.decision1||' '||ad.decision2||' '|| ad.decision3||' '|| ad.decision4||' '|| ad.decision5 Decisions,
                    /*  Deposit Date uses the last term entered in :p_term parameter string */
                    (SELECT MAX(deposit_effective_date) FROM usf_as_deposit WHERE account_uid = a.person_uid &term_clause group by account_uid)   AS "DEPOSIT DATE",     
                    ph.phone as PHONE,
                    CASE WHEN PS.FIRST_CONTACT IN ('NET','PAP','COM','COP') THEN PS.First_Contact
                     ELSE CASE WHEN ps.latest_contact IN ('NET','PAP','COM','COP') THEN PS.Latest_Contact
                                ELSE '  '
                                END
                    END AS FIRST_CONTACT,
                    DECODE(:p_address,'Y',REPLACE(adr.street1||' '||adr.street2||' '||adr.street3||' '||adr.city||','||adr.state||' '||adr.nation||' '||adr.zip,'  ',' '),' ') as  address, adr.nation, adr.state,
                    goremal_email_address email, a.residency, a.application_date, p.primary_ethnicity, c.cohort
    FROM MST_ADMISSIONS_APPLICATION A,
               MST_PERSON p,mst_pre_student PS,  Admissions_Cohort c, usf_v_phone_pr_ma ph,
               MST_admissions_decision_slot AD, usf_v_email, usf_v_address_dr_lr_ma_pr adr
    WHERE a.PERSON_UID = p.person_uid
            AND a.curriculum_priority  = 1
            AND a.person_uid = ps.person_uid
           AND a.person_uid = ad.person_Uid(+)
           AND a.person_uid = goremal_pidm(+)
           AND a.person_uid = adr.pidm(+)
           AND a.person_uid = ph.pidm(+)
           AND ph.rnum(+) = 1
           AND a.person_uid = c.person_uid(+)
           AND a.academic_period = c.academic_period(+)
      &Where_Clause
           /*    TAKE OUT FOLLOWING LINE AFTER DATA IS CLEANED UP  */
            AND NOT(p.id_number = '00000000'   OR SUBSTR(p.id_number,1,1) = 'B'  OR UPPER(p.full_name_lfmi)  LIKE '%TESTING%')
           AND  a.application_status_date >= NVL(:p_as_of_date,sysdate-8000)
           AND a.academic_period = ad.academic_period(+)
            AND a.application_number = ad.application_number(+)
            AND a.degree <> 'ND'    /*   AND a.college <> 'LW'                         --  Does not need non-degree and law students    */
           &Cohort_Clause 
    ORDER BY Program  &ORDER_CLAUSE

    Hi Denis,
    I tried your suggestion. The good thing is that adding the comma allowed me to be able to add a.campus to the select statement, unfortunately, another error message happened.
    ORA-00936: missing expression SELECT p . person_uid PIDM_KEY ,
    p . id_number , p . full_name_lfmi name , p . BIRTH_DATE , p . GENDER Sex ,
    Decode ( a . residency , 'D' , p . Primary_Ethnicity , 'F' ) Ethn , a . academic_period TERM ,
    CASE WHEN : P_group_by = 'PROGRAM THEN a I started over and tried only putting in the comma and get the same message even though I didn't add campus. After that, removed the comma which led to the ORA-00933 error message. So once again, I had to close the file without saving, in order for the report to run at all.

  • Connect Oracle Reports to Ms Sql Server DB

    Is it possilbe to Connect Oracle Reports to Microsoft Sql Server database. If yes then how. Please advice.
    Thanks
    Sami.

    It is possible to connect Oracle database to MS Sql server database using the Oracle Transparent Gateway for MS SQL Server.
    You can use the following links to configure such connection:
    Oracle Transparent Gateways - General Description - Part I
    http://oracle-apps-dba.blogspot.com/2008/04/oracle-transparent-gateways-general.html
    Oracle Transparent Gateway for MS SQL Server - Part II
    http://oracle-apps-dba.blogspot.com/2008/04/oracle-transparent-gateway-for-ms-sql_16.html
    Aviad

  • Pl/sql in oracle reports 6.0

    Hi ,
    I am new to oracle reports, is there any way to use pl/sql in oracle reports.I mean i have to take aggregate data from Oracle and to print/populate the data according to slabs(Say distance slab or time slab).Can u please provide me sample code...
    mail id : [email protected]
    thanks & regards
    Anand M

    you can use ref cursor in your pl/sql stored procedure and then call it in your reports

  • Sql Server Reporting  services with ORACLE

    We are thinking of using Sql Server Reporting servicesvwith an ORACLE DB.
    I will like to know the pros and cons.
    Any advice would be appreciated..
    Thanks alot.

    Hello,
    You'll find many doc, examples, demos ... on OTN :
    http://www.oracle.com/technology/products/reports/index.html
    http://www.oracle.com/technology/documentation/reports.html
    http://www.oracle.com/technology/products/reports/htdocs/search.html?cat=ALP&col=ALC&submit=Search
    For the Ref Cursors :
    Oracle® Reports Building Reports
    10g Release 2 (10.1.2)
    B13895-01
    40 Building a Paper Report with REF CURSORs
    Regards

  • Calling PL/SQL Functions And Open Oracle Reports From ADF Application

    Hi all,
    My company will convert some projects from Oracle forms to Oracle ADF so, we need to call the PL/SQL functions and open the Oracle Reports (which are already exist) from ADF Application.
    Thank You..
    Jack.N

    Hi Jack.N,
    calling PL/SQL Functions -----> http://sameh-nassar.blogspot.com/2010/01/create-plsql-function-and-call-it-from.html
    Open Oracle Reports ---------> http://radio-weblogs.com/0137094/2008/06/15.html
    You will find The Integration between ADF and other systems in ---> http://wiki.oracle.com/page/ADF+Integration
    Sameh Nassar

Maybe you are looking for

  • How to disable html tags in richtext editor

    Hi All, I want to disable the html tags in rich text editor.I am able to disable the all components using the following code af:richTextEditor id="rte2" toolboxLayout="spellcheck"/> <f:facet name="spellcheck"> <af:commandLink id="chek" text="Check Sp

  • Help changing a run continuously VI into a run once

    Hi, I know that I am probably going to invoke the wrath of the labview gods with this request by not going through my tutorials again but I am unfortunately stuck and getting a bit of a brain freeze on this one. I have a VI for a flow meter, that run

  • Invoice no & grn no against PO

    Hi Experts,   Is there any standrd report in 4.7E in which give the e invoice no & grn no against a PO(line item wist). In me2n, ME2L report, it show the graphical view in POH colome.I want this in list form. Regards, sp sahu

  • WhAt Is WrOnG WiTh ThEUpPeR/loWeRCase

    I use the GoBooks app but can never find the Books folder that appears in the desktop manager. Does anyone know where it is? I end up storing books in the download folder because I can't find them otherwise. Also, what the bleep is going wrong with t

  • Re-installation problem.... OSX

    Hi every time when I tries to re-install my system after loading disk from DVD I gating message that I need to do a hard reset what cude be a problem i atempt to do  reinstoll so many time and seam scenario same situation eny sugestion ?????