Report Using PL/SQL Region

Hi,
I have bit experiment create custom reports using PL/SQL region
http://dbswh.webhop.net/apex/f?p=BLOG:READ:0::::ARTICLE:97800346956448
I would like have from you tips and ideas how enhance this.
Because I'm not so good with SQL,
I really appreciate if you have tips enhance performance for query used for cursor.
    /* Report query */
    l_sql := '
      SELECT * FROM(
        SELECT a.*, row_number() OVER (ORDER BY '
        || l_sort_col
        || ' '
        || l_sort_ord
        || ') rn, COUNT(1) over() mrn
        FROM(' || l_sql || ') a
      ) WHERE rn BETWEEN ' || l_start_row || ' AND ' || l_last_row
    ; Regards,
Jari

Hi Jari
I'm guessing you're trying to do paginated grid data or somewthing similar? You could try something like this...
    l_sql := 'SELECT * '||
           'FROM ('||
                  'SELECT /*+ FIRST_ROWS(n) */ '||
                          'a.*, ROWNUM rnum '||
                   'FROM ('||l_sql||' '||
                          'ORDER BY '||l_sort||' '||l_dir||') a '||
                   'WHERE ROWNUM <= '||l_max_row||') '||
           'WHERE rnum >= '||l_start;The variables would be initialized in the procedure as follows...
    l_max_row := p_start + p_limit;
    l_start   := p_start + 1;
    l_sort    := NVL(p_sort,'1');
    l_dir     := NVL(p_dir, 'ASC');My application process would be called something like follows, to spit out a JSON object...
BEGIN
  htp.p(wwv_flow.g_widget_num_return||'(');
  munky_extjs.grid_json(p_app_id => wwv_flow.g_x01,
                    p_app_page_id => wwv_flow.g_x02,
                    p_region_id => TO_NUMBER(wwv_flow.g_x03),
                    p_start => NVL(wwv_flow.g_x04,0),
                    p_limit => NVL(wwv_flow.g_x05,10),
                    p_sort => wwv_flow.g_x06,
                    p_dir => wwv_flow.g_x07);
  htp.p(')');
END;I think your use of analytics in the inner query may be slowing you down if you have a lot of data?
Cheers
Ben

Similar Messages

  • Building a report using "PL/SQL Dynamic Content" can I have it output PDF?

    Hi,
    I build several reports using the "PL/SQL Dynamic Content" region and htp.p().
    The output is exactly what the customer wants but they would now like to have it go into PDF document.
    Is there a way to do it?
    Bill

    Bill,
    You can integrate APEX with Oracle BI Publisher and have your report generated to PDF.
    If you're just interested in saving what is on a web page in PDF, have a look at CuteFTP (Windows), which is a free print driver that allows you to "print" to a PDF file as if it were a printer. On the Mac, you can save to PDF and do not need any additional software.
    Thanks,
    &#150; Scott &#150;
    http://spendolini.blogspot.com/
    http://sumnertech.com/

  • Report using PL\SQL

    Is one able to use PL\SQL code in a report. I would like to have a procedre which runs off a bind variable if possible?
    Thanks

    Unfortunately, if you are on 1.5.0 or 1.5.1 this report style won't work (there is a bug that removes all of the ;s from the PL/SQL code). According to Re: Report style plsql-dbms_output - bug this is fixed in 1.5.3, when that is released.
    theFurryOne

  • DBI Reports Using PL/SQL Procedure

    Hi all,
    Is there anyone who worked on Creating a DBI report using a PL/SQL Procedure.
    I want to customize a Report that is using Data Source as of type PL/SQL Procedure.
    Please Reply to me If anyone has any Idea on this..
    Thanks in Advance..

    Hi Blushadow
    Now if i want to update say only 10 records at a time what should i put into my Proc?
    Please go thru my Proc below..
    CREATE OR REPLACE PROCEDURE PRTS.UPDT_ISSUE_USR_ROLE
    As
    Cursor cur_user_role Is
    Select a.org_id,a.user_id
    from prts_user a,issue_user_role b
    where a.user_id=b.user_id;
    upd_rec cur_user_role%rowtype;
    v_rows_processed Number:=0;
    Begin
    Open cur_user_role;
    Loop
    Fetch cur_user_role into upd_rec;
    If cur_user_role%NOTFOUND
    Then
    Exit;
    Else
    update Issue_user_role
    set User_org_nm=(Select full_org_nm from VW_Org where org_id=upd_rec.org_id)
    Where Issue_User_Role.rowid in
    (select issue_user_role.rowid
    FROM issue_user_role,issue,issue_workflow,Issue_step_dtl_wrkflw
    Where Issue_User_Role.Issue_Id=Issue.Issue_id
    And Issue_User_Role.Issue_id=issue_workflow.issue_id
    And Issue_User_Role.Workflow_compnt_id=Issue_Workflow.CURR_STEP_WORKFLOW_COMPNT_ID
    And Issue_User_Role.Workflow_compnt_id=Issue_Step_Dtl_wrkflw.Workflow_compnt_id
    And Issue_User_Role.Issue_id=Issue_Step_Dtl_wrkflw.Issue_Id
    And Issue.Issue_id=Issue_workflow.Issue_Id
    And Issue.Issue_id=Issue_Step_Dtl_Wrkflw.Issue_id
    And Issue_workflow.Issue_id=Issue_Step_Dtl_Wrkflw.Issue_id
    And Issue_Workflow.CURR_STEP_WORKFLOW_COMPNT_ID=Issue_Step_Dtl_wrkflw.Workflow_compnt_id
    And issue_workflow.primry_workflow_flag='Y'
    And issue_user_role.user_id = upd_rec.user_id
    And issue.issue_status_id in (1636,50738,275,50737,2090)
    And issue_step_dtl_wrkflw.Issue_step_status_id in (61248,61249,61250));
    v_rows_processed :=v_rows_processed + SQL%ROWCOUNT;
    If Mod (v_rows_processed,v_rows_processed)=10
    then
    COMMIT;
    End if;END IF;
    End Loop;
    Commit;
    dbms_output.enable(1000000);
    dbms_output.put_line('There were '||v_rows_processed||' rows updated');
    Close cur_user_role;
    End;
    I would appreciate if you can let me know any other alternative way to meet this requirment.
    Cheers
    Vineet

  • Creating XML report using PL/SQL Stored Procedure

    Hi Friends,
    I am working on an xml report with the xml source as PL/SQL Stored Procedure.
    I am referring the exercise shown in the following link to understand the process:
       http://orclapp.blogspot.com/2012/02/developing-xml-publisher-report-using.html
    In the example shown in the above link I could not understand the following:
    1) In the following procedure, the out parameter 'retcode' is not used at all.
       What is the importance of this parameter.
        PROCEDURE REPORT (errbuf  OUT VARCHAR2, retcode  OUT VARCHAR2, p_product_id   IN     NUMBER)
    2)  After the xml data is prepared and put to 'l_result' Clob variable, the following
        Loop is executed. I am not able to appreciate why the following loop is required.
         LOOP
             EXIT WHEN l_length = l_retrieved;
             IF (l_length - l_retrieved) < 32000
             THEN
                SELECT SUBSTR (l_result, l_retrieved + 1) INTO l_xmlstr FROM DUAL;
                l_retrieved := l_length;
                fnd_file.put_line (fnd_file.output, l_xmlstr);
             ELSE
                SELECT SUBSTR (l_result, l_retrieved + 1, l_offset)
                  INTO l_xmlstr
                  FROM DUAL;
                l_retrieved := l_retrieved + l_offset;
                fnd_file.put_line (fnd_file.output, l_xmlstr);
             END IF;
         END LOOP;
    3) In the example it is not explained how the concurrent program gets the xml data?
       I assume it is written to a file using the following line of code:
        fnd_file.put_line (fnd_file.output, l_xmlstr);
       I would appreciate if anyone can throw some light into my above queries so that I can understand the process clearly.
    Thanks & Regards
    Hawker

    Hi 32000 in the code is a 'safe' size smaller than the max available 32767, the loops purpose is to move through the entire thing in chunks that will be manageable in the limits of the data type.
    Btw; if you are in Oracle e-business suite then you can also use Oracle reports very simply to create XML output.
    If you have reports developer all you need to do is put raw sql (without any 'artifice' to create XML) in the report SQL and then set the reports output to XML in the program definition in Oracle e-business.
    best regards,
    Robert.

  • Urgent: Issue while displaying the PDF Reports Using XDO Common region

    Hi all,
    In our product code we are trying to display the PDF Reports, using the xdo common region.
    Previously we were writing the pdf reports direclty onto the response direclty.
    This displays the report onto the browser but if navigate throw browser back button, it doesn't displays the report as the response stream is empty while navigating through back button.
    So to solve this issue, i tried to write the report using the OAHTMLWebBean and xdo common region. Here is the code:
    ByteArrayOutputStream xdoOutput = new ByteArrayOutputStream();
    XDOUtility.retrieveReport(xdoOutput,
    parameters,
    prop,
    appMod
    BlobDomain bxdoOutput = new BlobDomain();
    bxdoOutput.setBytes(xdoOutput.toByteArray());
    String redirectURL = DocumentHelper.getOutputURL(pageContext,
    bxdoOutput,
    "Report",
    "PDF");
    OAHTMLWebBean outRegion = (OAHTMLWebBean)createWebBean (pageContext, OAWebBeanConstants.HTML_WEB_BEAN, null, "IFRAME");
    outRegion.setHTMLAttributeValue("src", redirectURL);
    outRegion.setHTMLAttributeValue("width", "100%");
    outRegion.setHTMLAttributeValue("height", "100%");
    outRegion.setHTMLAttributeValue("title","Report");
    outRegion.setHTMLAttributeValue("name","Report");
    pageContext.getPageLayoutBean().addIndexedChild(outRegion);
    This successfully displays the report in the XDO Common region. But now the issue is that there are hyperlinks in the Report displayed where from where the user can navigate to other detail pages.
    When we click on these links, a new session starts in the xdo common region.
    Is it possible that when the user click the links in the report displayed, instead of starting a new session in the xdo region, the detail pages is displayed with in the older session.
    Regards
    Sandeep

    Hi all,
    In our product code we are trying to display the PDF Reports, using the xdo common region.
    Previously we were writing the pdf reports direclty onto the response direclty.
    This displays the report onto the browser but if navigate throw browser back button, it doesn't displays the report as the response stream is empty while navigating through back button.
    So to solve this issue, i tried to write the report using the OAHTMLWebBean and xdo common region. Here is the code:
    ByteArrayOutputStream xdoOutput = new ByteArrayOutputStream();
    XDOUtility.retrieveReport(xdoOutput,
    parameters,
    prop,
    appMod
    BlobDomain bxdoOutput = new BlobDomain();
    bxdoOutput.setBytes(xdoOutput.toByteArray());
    String redirectURL = DocumentHelper.getOutputURL(pageContext,
    bxdoOutput,
    "Report",
    "PDF");
    OAHTMLWebBean outRegion = (OAHTMLWebBean)createWebBean (pageContext, OAWebBeanConstants.HTML_WEB_BEAN, null, "IFRAME");
    outRegion.setHTMLAttributeValue("src", redirectURL);
    outRegion.setHTMLAttributeValue("width", "100%");
    outRegion.setHTMLAttributeValue("height", "100%");
    outRegion.setHTMLAttributeValue("title","Report");
    outRegion.setHTMLAttributeValue("name","Report");
    pageContext.getPageLayoutBean().addIndexedChild(outRegion);
    This successfully displays the report in the XDO Common region. But now the issue is that there are hyperlinks in the Report displayed where from where the user can navigate to other detail pages.
    When we click on these links, a new session starts in the xdo common region.
    Is it possible that when the user click the links in the report displayed, instead of starting a new session in the xdo region, the detail pages is displayed with in the older session.
    Regards
    Sandeep

  • Item data using PL/SQL block region

    hello community,
    I have searched the whole forum using Pl/SQL but couldn't find an answer for this.
    I have a PL/SQL Anonymous block region, containing database items fetched by a process and custom items getting set by the Pl/SQL source.
    based on the ID I am getting the records i.e.
    Region Source (PL/SQL Anonymous block)
    declare
    CURSOR cpc_cur is SELECT "PRODUCT", "APPCODE", "COMCODE", "DESCRIPTION" from cp2 where "ID" = :P4_ID;
    begin
    for cpc_rec in cpc_cur
    loop
    :P4_P_NAME := cpc_rec.product;
    end loop;
    end;
    The custom item is text field with source Item.
    The item value is not filled in for the first time after login, but it shows the value in the session state as with status 'I', but from then onwards it works fine.
    Why is the value not fetched the first time?
    even I tried the postcalculation using nvl and it sets it to null.
    Also set_session state doesn't work.
    If I make the custom Item as Pl/SQL function, and write the query then it works fine, but gives problem as while inserting a new record the query has no ID to refer.
    Thanks in advance.
    Piyush

    Thanks Scott!!
    1) I am using PL/SQL region to get the data for few items on the form region which is based on a table, all table attributes are database items and additional Items whose data I am fetching from the PL/SQL are Custom items.
    2) Yes the loop executes only once per page view, Is their a better query?
    3) Well its very dumb to have a item source as item pointing to itself, but since the values are in session with status 'I' I thought this could do the trick!
    4) As the item source type used is [only..], the first time user logs in it doesn't displays the value, need to refresh the page, but the second time its gets the values form the session.
    5) If I make the Item source as PL/SQL function, I just fetch the records individually, same as in the query which works fine, but the items are also used for insertion (add new) and I clear the cache, so it gives error as it cannot execute the pl/sql function(no ID while addition)
    I hope I have answered your questions! If you have patience you can read the detail description.
    test application on oracle server
    http://apex.oracle.com/pls/otn/f?p=24296:1:3544773135949858:::::
    login/password test/test
    Application name :Test
    The page has 2 regions. when clicking on SN the values are transfered to form, except for 'Appcode'.
    Detail Description:
    I have a page with 2 regions.
    One region is a report region showing fewer details from a view. The other region is a PL/SQL(form region), which shows all the details and is linked to the report region.
    While linking I pass the ID from report and autofetch the data in form region.
    But some Items are not related to that database, so I created few items on form region (Custom Items). To fill in these values I did these things.
    1) Pass them through script (but passing 7 parameters through script is not good)
    2) Made another autofetch process to fetch the remaining Items, but it seems that its not possible to have 2 autofetch process on one form region.
    3) Changed the form type from HTML to PL/SQL, to assign the custom items values through code.
    for cpc_rec in cpc_cur
    loop
    :P_custom_item := cpc_rec.data;
    end loop;
    Either make source type static or Item (the same item P_custom_item).
    This pl/sql code do assign them the values, In the session state their status is 'I', but are not displayed on the page for the first login, need to refresh the page, as the source used is (only when..) it gets the value the second time.
    4) Made the item source as PL/SQL function and assign them the value. It works fine, but the same item is also used displaying description while insertion(gives error while insertion), so made a conditional process, even that gives the same error.
    I have a questions.
    If an Item status is 'I' in the session state, why is it not displaying the value on page.
    Thanking you in anticipation
    Piyush
    Message was edited by:
    user523112

  • 4.1EA2 User-Defined-Report strips CRLF when using PL/SQL DBMS Output

    Hi,
    I have a report with a child report.
    That child report uses pl/sql to print to the screen. (dbms output)
    When i use the procedure manually it prints fine.
    When i copy this output to a text editor i can see the CRLF in there.
    If i call the same procedure tru the reports section of SQLDeveloper the output is stripped of any CRLF characters.
    This is causing it to be useless for me: i am using it to generate code and it all appears as one big line on the screen.
    Copying this to a text editor indeed shows all CRLFs gone.
    Is this intentional or a bug ?

    Jeff,
    Thnx for the answer.
    I don't have a problem writing html in my code being a former webdeveloper with experience in apex as well.
    The problem is that the option presents itself as a standard plsql dbmsoutput, which suggests identical output as a dbmsoutput pane in sqldeveloper.
    From your answer i gather it really is supposed to do html formatting.
    Your "solution" of inserting br tags would be fine if it weren't for the fact that when i do a copy of the output in this report pane sqldeveloper strips away the br tags but doesn't replace them with crlf's.
    And since the crlfs that were in the output are also stripped in this result pane i get a single line of text when i copy over a page of text from the result pane into a normal texteditor.
    As such it behaves differently then say a browser when i copy a page of text from the browser and paste it in a text editor. There i see the crlfs that were present in the original source.
    Is there a listing somewhere that explains what tags are supported?
    Or CSS ?
    Does it support stuff like white-space: pre ?
    I understand the usefullness of a html-aware plsql dbmsoutput output option in the reports list of a user-defined report.
    However i would like to use this opportunity to advocate to include , as an extra option or tick box etc., an option to just display the output as the normal dbmsoutput pane displays it.
    That is without extra formatting.
    I like the idea of being able to click in the table section above and to have bottom pane generate the appropriate code as output.
    That  use-case can not happen right now since it formats as html (and not even the correct way) or, when going along with this route, strips everything to a single line of text when copying the data from the result pane.
    rgrds mike

  • Integrating BiP scheduler using PL/SQL

    Excuse me, I am relatively new to this, but I have a requirement to integrate BiP scheduler with a batch job scheduler running on Windows that uses the corporate calendar. The batch job scheduler can call pl/sql , Java, JS , VB.. code , but I am more interested in the pl/sql option.
    Could you please confirm that it is possible to call the BiP scheduler Webservices using pl/sql code ? are there any issues or porblems doing that ? I am familiar with PL/SQL web services but not sure about the BiP interface and how easy it is to integrate to it using web services.
    Thanks.

    Yes, I did that kind of integration but not with BIP, so I got the background to call web services from PL/SQL but not sure about the BIP API and parameters, this is why I asked if somebody already did something close to this it will help to understand the BIP webservices API . I would really appreciate if you can show some sample code, does not need to be complete.
    And Vetsrini , did you have the same requirement? ( to run or schedule BIP reports using pl/sql code )

  • Connecting a report region and a PL/SQL region

    Hi,
    I have created a report region whith pagination that only show 1 row at a time. I can then navigate backwards and forwards through this recordset. The first reportcolum in this recordset contains a number.
    I have also, on the same page, created a PL/SQL procedure region. What I want is to use the number from the SQL region as an input to the PL/SQL region. So when I navigate through the report (Using the pagination arrows), the PL/SQL region is in sync with the record I'm currently seeing in the report.
    Is this possible or do I have to try something different?
    Regards
    Trond

    Hi Trond,
    If you only want to show one record in your first region, it might be best to work with page items, retrieve one record at a time and use that data as the source for your page items. It's easier to implement and easier to reference those values in your second region. Reports are great if you have more then one record.
    Having said that, there are ways to implement it the way you outlined it in your posting. Granted it's not very elegant but it serves its purpose. You could write your own PL/SQL package, use this to set a global to the current row's primary key value and reference that global in your second region.
    Create your package as follows:
    create or replace package md_sample as
    g_pk_value number;
    function set_value(p_value number) return number;
    end;
    create or replace package body md_sample as
    function set_value(p_value in number) return number is
    begin
    g_pk_value := p_value;
    return 1;
    end;
    end;
    Now you need to make sure that your report calls this package appropriately. Calling this as part of your SQL statement won't work properly as it would also be called for records not currently shown on your page. A better way would be to use it for a PL/SQL expression within your report template definition. Pick a custom report template for your report and edit that template. Scroll down to the condition for the first column template and pick “Use Based on PL/SQL Expression”. Then type in the following expression (this is based on a select deptno, dname, loc from dept report):
    md_sample.set_value(#DEPTNO#)=1
    After that you'll be able to reference the global md_sample.g_pk_value. You could e.g. use this as the source for page items shown in your second region.
    Hope this helps,
    Marc

  • Report To Show SQL Used In A Report

    I am creating a set of quality reports using the apex views.
    I would like to create a report to check the sql used in classic reports, but can't seem to find the right view to use.
    If it was a interactive report I would use the SQL_QUERY column in the APEX_APPLICATION_PAGE_IR view, but this does not seem to exist for classic reports
    Help appreciated.
    Gus

    Gus C wrote:
    I am creating a set of quality reports using the apex views.
    I would like to create a report to check the sql used in classic reports, but can't seem to find the right view to use.
    If it was a interactive report I would use the SQL_QUERY column in the APEX_APPLICATION_PAGE_IR view, but this does not seem to exist for classic reports
    You can use the Data dictionary view APEX_APPLICATION_PAGE_REGIONS. There's a field called "REGION_SOURCE" - just filter for the appropriate region type.
    Help appreciated.Really? What about Re: Validate Date and Time? If you want to show genuine appreciation for help given, why not award "correct/helpful" points to posts which helped you solve your problem, as per the forum introduction post:
    >
    * It is considered good etiquette to reward answers with points (as "helpful" - 5 pts - or "correct" - 10pts).
    >
    Having a brief look through your list of recently answered questions, you don't seem to award helpful points, even when you've explicitly saying (paraphrasing) "Thanks for your help". Maybe it's a tipping thing - perhaps you subscribe to the doctrine of Mr. Pink but, hey if it helps you get your question answered and it literally costs you nothing but a few seconds of effort, why not throw us a bone by awarding a point now and then?

  • Calling an On Demand Process in PL/SQL Region without using AJAX

    Hi!
    I am trying to find a way to call an On demand Process in a PL/SQL Reports Region. The reason is that i need Reportings for about 20 Pages that look like the same but have different parameters. I already have some Processes that return SQL Statements and it works fine. But these Reportings are more complex and it's not possible to return it wirh a SQL Statement.
    I have seen some solutions in this forum that used AJAX to call such a process. The problem is, that I'm not allowed to use AJAX because activeX is diabled. I tried it and it works but i need another way to solve this process call.
    Thanks in advance
    Philipp

    At the moment I cannot say if your link can help. Right now the call of the On demand Process looks like this:
    Inside annonymous PL/SQL Region:
    <script type="text/javascript">
    get = new htmldb_Get(null,'||:APP_ID||'.,'APPLICATION_PROCESS=F_REPORT_NAME',0);
    gReturn = get.get();
    document.write(gReturn);
    </script>

  • DESKI Report using Temp tables in MS- SQL server 2005

    Hi,
    I am trying to create a Free hand SQL DESKI report using temp tables in MS SQL Server-2005, I am using ODBC connection.
    When I run the report, I am getting the error
    u201CConnection or SQL sentence error (DA0005) No column or data to fetchu201D
    Ex:
    Select *
    into #t1
    from region
    select * from #t1
    drop table #t1
    Please help.
    Regards,
    Pratik

    Pratik, the SQL does not seem right. BTW you can only retreive data via Deski Free hand SQL. Also try to use OLE DB connection.

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

  • Report using ref cursor or dynamic Sql

    Hi,
    I never create a report using a ref cursor or a dynamic sql. Could any one help me to solve the below issue.
    I have 2 tables.
    1. Student_Record
    2. Student_csv_help
    Student_Record the main table where the data is stored.
    Student_csv_help will contain the all the column names of the Student_record.
    CREATE TABLE Student_CSV_HELP
    ENTRY_ID NUMBER,
    RAW_NAME VARCHAR2(40 BYTE),
    DESC_NAME VARCHAR2(1000 BYTE),
    IN_OUTPUT_LIST VARCHAR2(1 BYTE)
    SET DEFINE OFF;
    Insert into TOA_CSV_HELP
    (ENTRY_ID, RAW_NAME, DESC_NAME, IN_OUTPUT_LIST)
    Values
    (1, 'S_ID', 'Student ID', 'Y');
    Insert into TOA_CSV_HELP
    (ENTRY_ID, RAW_NAME, DESC_NAME, IN_OUTPUT_LIST)
    Values
    (2, 'S_Name', 'Student Name', 'Y');
    Insert into TOA_CSV_HELP
    (ENTRY_ID, RAW_NAME, DESC_NAME, IN_OUTPUT_LIST)
    Values
    (3, 'S_Join_date', 'Joining Date', 'Y');
    Insert into TOA_CSV_HELP
    (ENTRY_ID, RAW_NAME, DESC_NAME, IN_OUTPUT_LIST)
    Values
    (4, 'S_Address', 'Address', 'Y');
    Insert into TOA_CSV_HELP
    (ENTRY_ID, RAW_NAME, DESC_NAME, IN_OUTPUT_LIST)
    Values
    (5, 'S_Fee', 'Tution Fee', 'N');
    commit;
    CREATE TABLE Student_record
    S_ID NUMBER,
    S_Name VARCHAR2(100 BYTE),
    S_Join_date date,
    S_Address VARCHAR2(360 BYTE),
    S_Fee Number
    Insert into Student_record
    (S_ID, S_Name, S_Join_date, S_Address,S_Fee)
    Values
    (101, 'john', TO_DATE('12/17/2009 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'CA-94777', 2000);
    Insert into Student_record
    (S_ID, S_Name, S_Join_date, S_Address,S_Fee)
    Values
    (102, 'arif', TO_DATE('12/18/2009 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'CA-94444', 3000);
    Insert into Student_record
    (S_ID, S_Name, S_Join_date, S_Address,S_Fee)
    Values
    (103, 'raj', TO_DATE('12/19/2009 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'CA-94555', 2500);
    Insert into Student_record
    (S_ID, S_Name, S_Join_date, S_Address,S_Fee)
    Values
    (104, 'singh', TO_DATE('12/20/2009 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'CA-94666', 2000);
    Commit;
    Now my requirement is:
    I have a form with Student_record data block. When i Click on print Button on this form. It will open another window which has Student_CSV_HELP.DESC_NAME and a check box before this.
    The window look like as below:
    check_box       DESC_NAME+
    X                   S_ID+
    --                   S_Name+
    X                   S_Join_date+
    X                   S_Address+
    --                  S_Fee+
    X  means check box checked.+
    --  means check box Unchecked.+
    After i selected these check boxes i will send 2 parameters to the report server
    1. a string parameter to the report server which has the value 'S_ID,S_Join_date,S_Address' (p_column_name := 'S_ID,S_Join_date,S_Address');
    2. the s_id value from the student_record block (p_S_id := '101');
    Now my requirement is when i click on run. I need a report like as below:
    Student ID : 101+
    Joining Date : 12/17/2009 08:00:00+
    Address : CA-94777+
    This is nothing but the ref cursor should run like as below:
    Select S_id from student_record block S_id = :p_S_id;
    Select S_Join_date from student_record block S_id = :p_S_id;
    Select S_Address from student_record block S_id = :p_S_id;
    So, according to my understanding i have to select the columns at the run time. I dont have much knowledge in creating reports using ref cursor or dynamic sql.
    So please help me to solve this issue.
    Thanks in advance.

    Plain sql should satisfy your need. Try ....
    Select S_id, S_Join_date, S_Address
    from student_record
    where S_id = :p_S_id

Maybe you are looking for

  • Can't get 2 GBs on my 2GB MicroSD

    This may have less to do with my 5300 than my memory card and Mac but I just bought an AData 2GB MicroSD card to squeeze more music onto my phone. The problem is, after I get about 300 MBs on it, the card can't fit anymore music on it. But here's the

  • I click on iChat and nothing comes up

    iChat is in the dock on my macbook pro. I click it, the indicator light goes on and it says iChat in my menu bar at the top but no window comes up. I've tried restarting my computer. I've tried launching it from the launch pad. Nothing works. What do

  • Show/Hide buttons

    Hey everyone, Is there a way I can create a "Show" button that would be visible to users when they click "Hide" (or X) on the nav bar? The team I'm working with doesn't think that making users click the Contents, Search, or Index button to "Show" the

  • Display error messages in Call transaction

    Hi Gurus, I have donme BDC using call transaction..can anybody help me in displaying the error messages in call transaction.. A detailed code wud be very much helpful.. full marks wud given regards Sahil

  • HT4667 why can't i get the download to install on my macbook pro for the air port express

    why can't i get the download to install on my macbook pro for the air port express ?