Using CBO hints in Oracle reports 6i

Hi everyone,
I'm trying to add a simple hint to my a query defined in the datamodel of my report. The hint never shows up in v$sql at execution time.
I have a stong feeling that report chops the hint out because reports thinks it's a comment like any other comment.
Is there a way I can put hints in queries of Oracle Report 6i ????
Best regards,
Guillaume Goulet-Vallières

One alternative is having the hints in functions/packages in DB, if possible.

Similar Messages

  • 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;

  • How can I use unix commands from oracle report

    I have to use the following command from oracle reports.
    In oracle forms we can use the HOST command but what about oracle reports2.5.
    I have to email the attached file 100245.pdf from oracle reports to the given email id
    uuencode 100245.pdf 100245.pdf | mailx -s "test" [email protected]

    Hi,
    It's because .bat (or .cmd) files are scripts and not executables and are interpreted using the command line executable - which is normally cmd.exe (although you can buy others).
    So you need to call cmd.exe passing the bat file name as a parameter, something like
    cmd.exe /c batchfilename
    Without the /c you will never get a response.
    However, this brings us to the bizarre conclusion that you are going to:
    call cmd.exe (a shell interpreter)
    to launch a batch file
    that calls cygwin (another shell interpreter)
    which then runs ls
    When shouldn't that just be:
    call cmd.exe to run the dir command
    Or better yet, If you are just after a file name listing and you seem to understand Java stored procs, why not just write a JSP to list the contents of a directory? No problems with OS dependant commands, scripts and 3rd party interpreters. Plenty of examples of that out on the internet as well.
    HTH
    Chris

  • How to use lexical paramter in oracle reports

    I have a query like,
    select * from t1 where &c1=:v_srep;
    where t1 is tablename
    c1 is column name
    How do I create &c1 and how should I populate it ?
    Thanks,

    From Oracle 8.1.5 database, we can use dynamic ref cursors.
    With dynamic ref cursor we can really avoid the use of lexical parameters in Reports.
    With static ref cursor this is not possible in all cases.
    For example, if we need dynamic WHERE, we practically can't use static ref cursor.
    But, problem is that Reports needs static ref cursor type for building Report Layout.
    Solution (as i know, first published in my post in MetaLink Reports Forum,
    thread "Report based on Ref Cursor or PL/SQL Table", 24-Aug-01) is:
    in package specification we must have both ref cursor types,
    static for Report Layout and dynamic for ref cursor query.
    Dynamic ref cursor examples:
    "Dynamic Table in the Second Query with Oracle Reports"
    http://www.quest-pipelines.com/pipelines/plsql/tips03.htm#JULY
    "Using a Collection Instead of a Temporary Table in Complex Reports"
    http://www.quest-pipelines.com/pipelines/plsql/tips03.htm#NOVEMBER
    Regards,
    Zlatko Sirotic

  • About using cursor expressions in Oracle Reports

    I've just discovered a rather old syntax of the mighty select statement. It seems related to the concept of inline view or more precisely scalar view. It's the cursor syntax in a select statement.
    Example:
    select d.dname
    ,cursor(select e.empno,e.ename,sal
    from scott.emp e
    where e.deptno = d.deptno)
    from scott.dept d
    I have two questions:
    1) Performance: how is the performance of this select in comparison to standard join?
    2) Usage: I've use this from sqlplus and it's ok, but can't use it on a tool like Oracle Reports. Although the select statement is correctly processed, can't display it since the datatype is Database - Unknown ...
    It seems there´s no way to use cursor expressions at least if datasource is a SQL Query.
    Thanks in advance ....

    I think you have answered your own question: CURSOR is not something you can display.

  • Problem in finding Exact result by using the following in Oracle Reports 6i

    Hello,
    I am finding difficulty in producing the required result by using the following query in Reports 6i
    (Note: - The query actual output and the my required output are as follows: -)
    SELECT
    DISTINCT
    SH.S_HEAD_CODE,
    B.BILL_ID,
    B.SANCTION_DATE,
    E.EMP_NAME,
    E.EMP_DESIGNATION,
    B.TOTAL_BILL,
    NVL((SH.INITIAL_ALLOCATION-B.TOTAL_BILL), 0) BALANCE
    FROM BILL B, PARAMETERS P,SUB_HEAD SH, EMPLOYEES E, BILL_DETAIL BD
    WHERE
    SH.S_HEAD_CODE=B.S_HEAD_CODE
    AND B.S_HEAD_CODE=BD.S_HEAD_CODE
    AND B.EMP_ID_NO=E.EMP_ID_NO
    AND B.BILL_ID=BD.BILL_ID
    The Output of the above query is as follows: -
    Let say we have Total Amount Sanctioned Rs. 15,000,00/-
    Name Total Bill (Rs.) Balance (Rs.)
    Sohail 7147 1492853
    Saqib 2131 1497869
    Amir 6802 1493198
    Shafiq 1214 1498786
    Note:- In the above output the above query is subtracting the current balance from Total Sanctioned Amount (Rs. 1500000) each time, but
    it should actually subtract the current bill amount from the previous balance like the below said result.
    Name Total Bill (Rs.) Balance (Rs.)
    Sohail 7147 1492853 {Previous Balance - Current Bill Amount (1500000-7147) }........ The previous balance was actual amount Rs. 1500000
    Saqib 2131 1490722 {Previous Balance - Current Bill Amount (1492853 - 2131)}
    Amir 6802 1483920 {Previous Balance - Current Bill Amount (1490722 - 6802)}
    Shafiq 1214 1482706 {Previous Balance - Current Bill Amount (1483920 - 1214)}
    Results Continue...........................
    Please help me to solve this problem.
    Thank you in advance

    Its more like the case of a running total ...
    You could analytical functions to achieve it or make the BILL a subquery of the BALANCE.
    Try posting your query in the "SQL and PL/SQL" forum, veteran members there, can provide better answers.

  • Use css file in oracle 10g report builder

    hi every one
    i am using oracle 10g report buidler. i want control paramform by usign css file.
    any body have idea how can i use css file in oracle report builder 10g and how can i modify it's path and i how can i manage any css class on a perticular field.

    Thanks Billy.
    Yes you are right.
    Here why I discarded that option is,
    I may get the source files with changing layouts.
    My Actual scenario is as follows.
    Initially we developped all the things using PL/SQL packages. Its working fine.
    But as per the inputs we received from requirements group, the file structure changes dynamically. and we would able to consider those new columns also. We should be able to changes the rules dynamically.
    Lets say, we doing fullouter join on Src_A and Src_B. on columns col1_A and col1_B.
    Now the requirement changes in a way that, the join should be done on Src_A and Src_C. on columns col1_A and col_C.
    For this I need to define a new package.
    Instead of that, I would like to do everything dynamically based on configuration parameters given as input.
    Thank you,
    Regards,
    Gowtham Sen

  • Programmatically change the query used to generate Oracle Reports

    I have two queries. Depending on some parameter value, I would like to use one of these queries to generate my report. Is it possible to programmatically change the SQL query used to generate the Oracle Report.
    Thanks

    There are two options:
    - The easy way
    In the report paper layout create two frames, one for each query , and at runtime
    display only one based on your parameters. (using format triggers on the frames)
    - the not so easy way (but more elegant)
    create the query at runtime using xml customizations using the examples from
    the following documentation:
    http://download-
    uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_xml.htm#i1006734
    16.3 Creating XML Data Models
    16.4.1.3 Applying an XML Report Definition in PL/SQL
    16.4.1.3.2 Applying an XML Definition Stored in Memory
    Regards and Good Luck
    Ionut S

  • 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

  • How to use 2 d barcodes in reports 6i

    Hi,
    We have a requirement to use 2 D barcodes in Oracle reports 6i. Can anyone please advise as to how to do this?
    Thanks & Regards,
    Shailaja

    Hello,
    2D Barcode or matrix barcode are not supported in Oracle Reports(6i, 10g and 11g).
    An Enhancement request is logged in order to have the possibility to use 2D barcode with Oracle Reports.
    Please see Bug 8401811 ENH: NEED ABILITY TO DISPLAY AND PRINT TWO-DIMENSIONAL (2D) BARCODES which is still under review.
    I think IDautomation Java Component can create 2D Barcodes: http://www.idautomation.com/java/
    Oracle using Java:
    http://www.idautomation.com/oracle/java_barcode.html
    Regards,
    Alex
    Edited by: AlexDiniasi on 16.07.2012 17:07

  • 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

  • Best practices Oracle Reports

    Hi
    Can any one point me in the direction of some useful internet resources which discuss commonly used best practices by Oracle reports developers.
    I look forward to reading your responses.
    Kind regards,
    NaranH

    Hello,
    The following links offer most of the needed information of developing, deploying and running Oracle Reports:
    http://www.oracle.com/technetwork/middleware/reports/documentation/index.html
    http://docs.oracle.com/cd/E12839_01/bi.1111/b32122.pdf
    http://docs.oracle.com/cd/E15523_01/dev.htm
    Hope this helps,
    Alex
    If someone's answer is helpful or correct please mark it accordingly.

  • IPP with Oracle Report

    Hi all,
    I got reports error out when using IPP printer. It bursts out REP-177 and REP-713 errors in fact. Could anybody advice how-to use IPP printer with Oracle Report ?

    user9066239 wrote:
    Hi all,
    I got reports error out when using IPP printer. It bursts out REP-177 and REP-713 errors in fact. Could anybody advice how-to use IPP printer with Oracle Report ?Same Answer. 10g not supported.
    It's introduced in 11g.

  • SQR with Oracle Reports

    Hi,
    Can you use SQR code within Oracle reports
    Is there a way to convert SQR to Oracle Reports

    In some of our applications we are using Reports 6.0 and we have no problems with 9.2 DB.

  • Append hint + ADO + Oracle OleDB Provider

    Hi everybody!
    This is my first post here in this great forum! ;-)
    I have a problem using Append hint with Oracle OleDB Provider and I've been searching internet for an answer without any luck.
    I'm trying to use Append hint with ADO + Oracle OleDB Provider (OraOLEDB.Oracle.1), like in the SQL below:
    INSERT /*+APPEND*/
    INTO my_table(field1, field2, field3)
    SELECT 0 field1, v.field2, v.field3)
    FROM my_second_table v
    The problem: Oracle is still creting log for this INSERT (It is working like there was no Append hint).
    If I use the same SQL statement with Microsoft Ole DB Provider for Oracle, the Append hint works as expected (log is not created), but doesn't work at all with Oracle DB Provider.
    Trace shows me that the SQL sentence is ok (the append hint is there!).
    I've tried Oracle servers 9.2 and/or 10g, and the problem is the same.
    Question: Does Append hint work with Oracle OleDB Provider? If yes, why it is not working? Something related with connection properties?
    Any help will be much appreciated!
    Thanks in advance.
    Alexandre Machado

    user8010279 wrote:
    Hi Solomon, thanks for you answer.
    Is the same SQL against the same database, with the same program, using ADO + OleDB Provider.
    The table is in NOLOGGING mode.
    When I use Microsoft OleDB Provider for Oracle there is no log creation. Then I disconnect and reconnect to the same server/database, using Oracle OleDB Provider. Then I execute the same SQL and.... there IS log creation, meaning that in that scenario, append hint is being ignored. I can't figure out WHY!!! :-(
    Alexandre,
    I'm not sure what you mean by "there is log creation". In general you need to distinguish between UNDO and REDO generation. A direct-path insert (APPEND hint) doesn't generate undo but still can generate redo, depending on the ARCHIVELOG / FORCE LOGGING mode of the tablespace resp. database and the LOGGING/NOLOGGING attribute of the table.
    Note that in case indexes exist on the table there will always be undo and therefore redo generation for the index maintenance as part of the direct-path insert.
    You should check V$SESSION (SQL_ID in 10g, SQL_ADDRESS + SQL_HASH_VALUE in pre-10g) and V$SQL in the database to double check if the SQL passed by the Oracle OLEDB Provider actually contains the APPEND hint in case the INSERT actually generates UNDO (which is the indicator that shows you if the direct-path insert is used or not). Whether it generates REDO is - as already mentioned - depending on other factors.
    So the question is how have you determined if the direct-path insert mode has been used or not?
    The simplest approach to test if direct-path insert mode is used or not is to issue a query on the object inserted into after the insert before committing the transaction. If it fails with "ORA-12838: cannot read/modify an object after modifying it in parallel" then you successfully inserted using direct-path insert.
    Note that there a number of restrictions that prevent the direct-path insert from happening, in those cases the APPEND hint will be silently ignored, e.g. enabled triggers, foreign keys on the table. A quite comprehensive list of restrictions is listed in the manuals here:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28313/usingpe.htm#CACEJACE
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

Maybe you are looking for