Joining report regions

After I query a record from the personnel table(region), I then want to see the accesses(another region based on acesses table with a foreign key to personnel.

seems like a candidate for a master-detail form. You can use the Add Form- Master Detail wizard for this.
HTH

Similar Messages

  • PL/SQL Table use in report region query

    Hello,
    I have a package function which return pl/sql table. I want to create a report region based on this pl/sql table. Is it possible to do this kind of report in HTMLDB?
    Please guide me in this area.
    Thanks
    HA

    The htmldb_collections API (apec_collections in 2.2) is a very useful method for rendering reports and one I have used extensivly in the past.
    Once created and populated you can reference your collection as if it were a SQL table i.e.
    Select c001, c002, c003
    from htmldb_collections
    where collection_name = 'MY_COLLECTION';
    You can absolutly base an Apex Report region on collections. Just treat them as another table that you can select from, join to others etc.
    In order to utilise this you must do the following:
    1) Create your collection:
    note that collections only persist for the duration of your session and you can only see the data you inserted into the collection. Also I would create this collection as the Database user who owns the Apex Workspace
    htmldb_collection.create_or_truncate_collection ('MY_COLLECTION');
    2) Populate your collection:
    In your case I would set a loop construct that parses through your pl/sql table and assign all values as described below. I assumed that my_plsql_tab has 3 columns called Val1, Val2, Val3
    FOR x IN 1..my_plsql_tab.count
    LOOP
    htmldb_collection.add_member (p_collection_name => 'MY_COLLECTION',
    p_c001 => my_plsql_tab(x).val1,
    p_c002 => my_plsql_tab(x).val2,
    p_c003 => my_plsql_tab(x).val3
    END LOOP;
    Note that you can have upto 60 elements in your collection.
    3) Access your collection:
    Select c001, c002, c003
    from htmldb_collections
    where collection_name = 'MY_COLLECTION';
    This quesry can then form the source of your sql report region.
    Hope all that helps
    Duncan

  • ORA-01489 Received Generating SQL for Report Region

    I am new to Apex and I am running into an issue with an report region I am puzzled by. Just a foreword, I'm sure this hack solution will get a good share of facepalms and chuckles from those with far more experience. I welcome suggestions and criticism that are helpful and edifying!
    I am on Apex 4.0.2.00.07 running on 10g, I believe R2.
    A little background, my customer has asked an Excel spreadsheet be converted into a database application. As part of the transition they would like an export from the database that is in the same format as the current spreadsheet. Because the column count in this export is dynmic based on the number of records in a specific table, I decided to create a temporary table for the export. The column names in this temp table are based on a "name" column from the same data table so I end up with columns named 'REC_NAME A', 'REC_NAME B', etc. (e.g. Alpha Record, Papa Record, Echo Record, X-Ray Record). The column count is currently ~350 for the spreadsheet version.
    Because the column count is so large and the column names are dynamic I've run into a host of challenges and errors creating this export. I am a contractor in a corporate environmentm, so making changes to the apex environment or installation is beyond my influence and really beyond what could be justified by this single requirement for this project. I have tried procedures and apex plug-ins for generating the file however the UTL_FILE package is not available to me. I am currently generating the SQL for the query in a function and returning it to the report region in a single column (the user will be doing a text-to-column conversion later). The data is successfully being generated, however, the sql for the headers is where I am stumped.
    At first I thought it was because I returned both queries as one and they were joined with a 'union all'. However, after looking closer, the SQL being returned for the headers is about +10K+ characters long. The SQL being returned for the data is about +14k+. As mentioned above, the data is being generated and exported, however when I generate the SQL for the headers I am receiving a report error with "ORA-01489: result of string concatenation is too long" in the file. I am puzzled why a shorter string is generating this message. I took the function from both pages and ran them in a SQL command prompt and both return their string values without errors.
    I'm hopeful that it's something obvious and noobish that I'm overlooking.
    here is the code:
    data SQL function:
    declare
      l_tbl varchar2(20);
      l_ret varchar2(32767);
      l_c number := 0;
      l_dlim varchar2(3) := '''|''';
    begin
      l_tbl := 'EXPORT_STEP';
      l_ret := 'select ';
      for rec in (select column_name from user_tab_columns where table_name = l_tbl order by column_id)
      loop
        if l_c = 1 then
            l_ret := l_ret || '||' || l_dlim || '|| to_char("'||rec.column_name||'")';
        else
            l_c := 1;
            l_ret := l_ret || ' to_char("' || rec.column_name || '")';
        end if;
      end loop;
        l_ret := l_ret || ' from ' || l_tbl;
      dbms_output.put_line(l_ret);
    end;header sql function:
    declare
      l_tbl varchar2(20);
      l_ret varchar2(32767);
      l_c number := 0;
      l_dlim varchar2(3) := '''|''';
    begin
      l_tbl := 'EXPORT_STEP';
      for rec in (select column_name from user_tab_columns where table_name = l_tbl order by column_id)
      loop
        if l_c = 1 then
            l_ret := l_ret || '||' || l_dlim || '||'''||rec.column_name||'''';
        else
            l_c := 1;
            l_ret := l_ret || '''' || rec.column_name || '''';
        end if;
      end loop;
        l_ret := l_ret || ' from dual';
      dbms_output.put_line(l_ret);
    end;-------
    EDIT: just a comment on the complexity of this export, each record in the back-end table adds 12 columns to my export table. Those 12 columns are coming from 5 different tables and are the product of a set of functions calculating or looking up their values. This is export is really a pivot table based on the records in another table.
    Edited by: nimda xinu on Mar 8, 2013 1:28 PM

    Thank you, Denes, for looking into my issue. I appreciate your time!
    It is unfortunately a business requirement. My customer has required that the data we are migrating to this app from a spreadsheet be exported in the same format, albeit temporarily. I still must meet the requirement. I'm working around the 350 columns by dumping everything into a single column, which is working for the data, however, the headers export is throwing the 01489 error. I did run into the error you posted in your reply. I attempted to work around it with the clob type but eneded up running into my string concatentation error again.
    I'm open to any suggestions at this point given that I have the data. I'm so close because the data is exporting, but because the columns are dynamic, the export does me little good without the headers to go along with it.

  • Report Region SQL Source

    Hello all...
    Im new to Application Express so my problems are quite fundamental. I am trying to create a filter system on a report region that alters the SQL depending which field is selected and what criteria is entered. How do I refer to the SQL? I sthere a system name for the region source sql or or can I refer to a column name in the SQL by useing a variable?
    i.e. ... WHERE <varColName> = <varSearchCriteria>
    Many Thanks,
    Richie

    I am trying to do the same thing, and I am not finding the answer either in the howtos or your demos (which are great). I tried to follow the instructions below, but I don't have a "Query Definition" tab, I have a Report Definition tab and it does not contain a Join Conditions page.
    Add a Condition
    To add a condition to the DEMO_ORDER_ITEMS report:
    1. Under Regions, select Order Items as shown in Figure 4-6.
    Figure 4-6 Order Items
    Description of Figure 4-6 follows
    Description of "Figure 4-6 Order Items"
    2. Click the Query Definition tab.
    3. Click Modify Join Conditions.
    4. On the Modify Join Conditions page:
    1. For the first Column, select DEMO_ORDER_ITEMS.ORDER_ID. Note that you may need to click Search to view available columns.
    2. In the second Column field, replace the existing text with the following condition:
    :P2_ORDER_ID
    5. Click Apply Changes.
    Here is the Source of my Report - I am getting this error: "Invalid PL/SQL expression condition: ORA-06502: PL/SQL: numeric or value error"
    select
    "IDENTIFIER",
    "APPLICATIONIDENTIFIER",
    "QUESTIONNUMBER",
    "ANSWERTEXT1",
    "ANSWERTEXT2",
    "ANSWERTEXT3"
    from "#OWNER#"."COMPANYPERSONNEL"
    WHERE "APPLICATIONIDENTIFIER" = :F101_APPLICATIONIDENTIFIER
    AND "QUESTIONNUMBER" = 1
    Appreciate any help. Thanks.
    Note: I tried TO_NUMBER(:F101_APPLICATIONIDENTIFIER) - same result
    Data Type for APPLICATIONIDENTIFIER = NUMBER(10)
    Data Type for QUESTIONNUMBER = NUMBER(2)

  • Adding and linking report region to a page with an existing report region

    I have page that has a report region. It is based on a master table.
    I want to add another report region to the same page for the detail.
    I have added the region of tpye HTML and entered the query in the source section.
    How do link this detail region with the master region. That is join the detail to query after the master based on the master row selected.

    This tutorial should help you:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/rprt_drill.htm#CIHGBADI
    It shows how to do it using two pages, but putting both reports on one page is pretty much the same.

  • Mutliple report regions on the same page querying same tbl

    Hello,
    I have a normal multiple report regions in a page with some editable in those regions, these report regions are querying the same table. Now, Is it possible to have one submit button for all the report regions to update the underlying table data?
    Can anyone please help me out with this one.
    thanks,
    Orton

    Sure, here are some details:
    Oracle apex version: Product Build:4.2.3.00.07
    Tables :
    STUDENTS - rows : student_id(PK), student_name ...
    COURSES - rows: course_id(PK), course_name, course_credit
    STUDENT_COURSE - rows: student_id(FK), course_id(FK), student_course_id(PK)
    I have a page where I show student's details. On this page I have access to student's id. The name of the field (on the page) is P9_STUDENT_ID. On the same page I want to have a table which is linked to an sql query that lists a student's courses, their credits, names etc.
    My sql query is the following:
    SELECT courses.course_id, courses.course_name, courses.course_credit
    FROM student_course INNER JOIN courses
                        on courses.course_id = student_course.course_id
                        WHERE student_course.student_id = 1
    Currently it displays all courses of student with Id = 1. I just want to replace this '1' with the actual student_id for the student we are currently displaying information for. Or, in this case P9_STUDENT_ID field's value. Don't know if this is the right way to do this, but still reading for options

  • Classic report regions not executing queries after clicking in a chart link

    I have a chart region with a link to page passing values to select list items, but report regions are not loading.
    This is the link generated at chart series:
    f?p=106:32:1310398926027:::RP:P32_DATE_SELECT,P32_SERVICE,P32_RESOURCE,P32_ROLE_ID:09%2F02%2F2013,1,EDER%20ZAVALA,1
    All page items passed are filled correctly, but report regions don't show any data.
    Please notice I am using two LOV where second one is showing values according the first one selected and doing the submit event where report regions are showing the result of the queries executed.
    Report regions shows data when I do the select of page items manually, but not when I pass those values thru link url
    I am using Oracle APEX 4.2.2.00.11
    Please advise
    Thanks,
    Cesar

    hi Vishal,
    Due to our client policies; I can not upload data. are you able to join to a webex meeting? so I can share you my screen and see the current problem I am having
    Here for your comments
    Thanks,
    Cesar

  • SQL Report Region

    Hi,
    I am using apex 4.0.1 and I have a page with several SQL Report regions. The user can edit the data in the report regions by clicking a column that uses a href link to open a DML page in a modal window. The user can then amend some data in the modal window, press save which closes the modal window and uses the partial page refresh process to refresh the SQL report region. (Using apex.event.trigger('#SOME_REGION'),'apexrefresh')).
    If I navigate through the report to show rows 31-45 and then click on a href to edit a record. On pressing save, the report is refreshed but the rows displayed goes back to 1-15.
    How can I get the report to stay showing the rows 31-45?
    Cheers
    Paul.

    I believe this answers my question
    http://monkeyonoracle.blogspot.com/2010/11/refresh-report-region-and-pagination.html
    Edited by: pjturley on Jan 10, 2012 1:14 PM

  • Dynamic action with interactive report region refresh

    Hi!
    I'm using APEX 4.02
    I've got a page with 2 regions.
    Region1 is a (input) form
    Region2 is an interactive report on the same table as region 1
    When entering values on the form I'm trying to dynmically lookup similar records in the table with the interactive report.
    I've made a dynamic action on the change of the form fields which should refresh the interactive report region. I can see this one fires if I add a alert to debug if it fires.
    The dynamic report is based on a query with bind variables pointing to the form fields, for example
    where
    field1 = :P2_FIELD1
    This works great on the page load, so no dynamic action is fired but I can see the rows in the report region are the ones I am looking for.
    But the refresh of the report region is not working, it is never refreshing and/or showing the correct data after a change of the form fields, so it looks like the dynamic action "refresh region" is not working on the interactive report.
    Any ideas why this can go wrong ?
    I would like to solve this using standard dynamic actions and preferrably not via PL/SQL or JS, shoudl be possible if I should believe the documentation... ;)
    Cheers
    Bas
    Edited by: bklerk on 26-apr-2011 3:07

    Hi,
    When you change value to item, I assume you do not set value to session state.
    Use interactive report advanced attributes "Page Items to Submit" , set items session state before report is refreshed.
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/app_comp.htm#sthref1235
    Similar post/issue here
    Hide and show region - hides on refresh
    Regards,
    Jari

  • Report Region show all rows?

    Hi,
    I have a report region in which I want to show all rows. Setting the pagination scheme to No Pagination doesn't
    seem to do the trick. I have set Number of Rows and Maximum Row Count both to NULL. Nothing seems to work.
    Is there some trick to get all rows to be displayed?
    Thanks in advance!

    Hi,
    I have two report regions on different pages. On both I have set 'Number of Rows' and 'Maximum Row Count' to null. One report will return all the records in a query (~800), the other report will only return 500. I can't see any other differences in the reports that would cause this behaviour.
    I didn't really want to restrict my reports to a set number of rows, is this really the only option?
    Thanks,
    Rochelle.
    Edited by: Rochelle K on Nov 5, 2009 10:13 AM

  • Performance issue for Report Regions

    We have an app which has as it's "Home Page" a portal-style page. The "portlets" are separate regions. Some of these regions are HTML forms, but most are report regions, invariably with PL/SQL returning the SQL query.
    On our dev box this portal renders fine, in no more than 5 seconds (acceptable). On the production box a couple of the portlets go crazy, usually taking between 1-2 minutes each. I know this because I added the #TIMING# string to each region footer. The portal page has a META tag to refresh every 120 seconds.
    The first thing I did to debug was to take the PL/SQL function body returning the SQL query, replace all the variables (which are just local vars, app items and page items) with hardcoded values, strip all quotes and run the "cleaned up" SQL query in SQLPlus. It executes very fast.
    So my conclusion is that the problem lies with the application server (which is Oracle iAS). Is this a logical conclusion? What should my next move be to get to the bottom of this?
    Even without the problem portlets the portal refresh speed varies widely, between <1 sec and >10 sec.
    The application also has other pages displaying the portal regions individually. These pages (including those with the "problem portlet" queries) render ok (ie, order of 5 seconds or less). This tells me that there is an issue with having a bunch of query-based regions on the same page.
    My guess is that I might need to examine the logs and/or httpd/modplsql settings of the app server. Number of simultaneous connections?
    What would happen if hundreds of users used this app concurrently, navigated to the portal page and left it like that to auto-refresh every 2 minutes? Are such pages a no-no in HTMLDB?

    Some more information:
    When I run the page in debug mode, I see the following timings for one of the problem portlets:
    11.53: show report
    11.54: determine column headings
    11.54: parse query
    60.95: binding: ":F118_BUNDLE"="F118_BUNDLE" value="1"
    60.95: binding: ":P52_STMETRICS_PRODBRANCH"="P52_STMETRICS_PRODBRANCH" value="RDBMS_MAIN"
    60.95: binding: ":P52_STMETRICS_PLATFORM"="P52_STMETRICS_PLATFORM" value="LINUX"
    61.35: print column headings
    61.35: rows loop: 15 row(s)
    [report is printed here]
    61.49: FORMITEM: P52_STMETRICS_PLATFORM HIDDEN
    61.54: FORMITEM: P52_STMETRICS_PRODBRANCH HIDDEN
    This tells me that the bulk of the time (50 seconds in this case) is eaten up in parsing the query. What is this symptomatic of?
    Another problem I've just noticed. It takes about 5 seconds to open up a region for editing (Region Definition) in HTMLDB. When I click "Apply Changes" (even without editing anything) it is taking on the order of minutes for the changes to be applied to the page. Our app server was bounced just before I noticed this.
    These are the params in our DAD:
    <Location /pls/toolsdb>
    SetHandler pls_handler
    Order deny,allow
    PlsqlDatabaseConnectString ...
    PlsqlDatabasePassword ...
    PlsqlDatabaseUsername ...
    PlsqlDefaultPage ...
    PlsqlDocumentPath docs
    </Location>

  • User Interface Template for Interactive Report Region

    In 3.2, where do we set the user interface template for Interactive Reports region?
    No matter what out of the box theme I switch to, the Interactive Reports region shows the same. What and where do I change the template so that alternating rows use two different colors?

    There is no template for Interactive Reports like for a "normal" report. You need to modify the CSS and supply your own for this to happen.
    I believe most things are tagged with #apexir - firebug with Firebox is invaluable. This thread may help:
    Re: changing the look and feel of interactive report.

  • How can i define the width of report column in report region ?

    Hi,
    I have report region and i want to have a static width for each column ( not based on column name of column data ), how can i do it ?
    Thanks in advance ,
    Yoel

    Can you provide more details pls? I am also trying to change widht of report columns and I do not see anywhere in reports atrributes where it allows me to do that...Thanks so much!

  • Link in report region

    Hi,
    I have report region(type=sql query). In that report region i want to add a hyperlink(View all). When user clicks on the hyperlink it should bring them to another page. Can anyone help me in this issue. i am using apex4.0.

    Where can i find button classIn the button template
    Usually(depend's on the theme) redirect buttons template are link tags with some class that styles them like a button. Else you can create such a button template(by copying it from another theme) without any styling
    For example a button template like
    &lt;a #BUTTON_ATTRIBUTES# class=&quot;&quot; href=&quot;#LINK#&quot;&gt;#LABEL#&lt;/a&gt;would render the button like a plain link

  • Change the 'No data found.' message in a report region

    I've got a report region (PL/SQL source) which sometimes returns no data, giving a 'No Data Found.' message.
    I couild have sworn there was an option to choose a custom message in the region definition when no data is returned - but I can't see that option. I guess it must have been in another region type.
    Is there some other way of setting the No Data Returned message?

    Hi,
    Check out this post:
    Hide the 'no data found' message
    I hope that helps.
    -Marc

Maybe you are looking for