Classic report SQL question.

Hello

Can I use Snap on command in a classic report using SQL? If so, how?

I use APEX 3.2.1 with Oracle database 10g.

Thank you
Mary

Published by: Gabriel on July 23, 2010 11:20

Hello Mary,.

WE BREAK is a SQL * more order thus is not allowed in the SQL of a usual report.

To do this is to use the Break formatting attributes report section. He limited to the break at first, & second or first, second & third columns rows retrieved, but it may be enough for what you're trying to accomplish.

Hope this helps,
John

Tags: Database

Similar Questions

  • Classic report SQL with BLOB column not refreshing with jQuery Trigger Apexrefresh call

    Hello

    Really hoping that someone can help me, but for some reason that I try to report updated in dynamic Action to help:

    jQuery('#my-report').trigger('apexrefresh');

    on a simple SQL query report classic. I have used this many times on other parts of the report but the only difference with the report region where it is not refreshing, is that the table contains a BLOB column as it is essentially a report of downloaded files that users have made to the page by using the file browse.

    Would really appreciate help with that basically, I don't want to perform a full page refresh, because it currently operates.

    It has to do with the fact that this report is the question about a BLOB column, which is a link to the uploaded file?

    Thank you.

    Tony.

    Hello

    Check this area of report model have id.
    You should have id = "" #REGION_STATIC_ID # "in the model of the region"

    Make sure you have correctly write the id of the report in JavaScript. JavaScript is case-sensitive

    Kind regards
    Jari

  • Classic report shows wrong "could not parse the SQL query: ORA-00942" error after migrating app to the new environment

    After migrating my APEX 4.1 application to a new environment, one classic report displays a "cannot parse the SQL query: ORA-00942: table or view does not exist" error when the page is displayed. Change the region to report SQL source to somehow (e.g., remove spaces, changing the order of the variables in the WHERE clause) immediately solves the problem, but by returning to the source of the region causes the report error again (the source region valid code without error, however).

    Throw the error message:

    Select v.id,

    v.Col1

    of view_vw v

    where (: P1_FILTER is null or)

    v.col2 = :P1_FILTER)

    Do not throw error:

    Select v.id,

    v.Col1

    of view_vw v

    where (:P1_FILTER is null or)

    v.col2 = :P1_FILTER)

    Changing the order of column in the report has the same effect; i.e. He arranges, but return back to the original column order causes the error to display.

    It's as if a cached result for the correct select statement used by the report is displayed. However, the application does not use the caching of page/region. Any ideas of what could be the cause?

    He solved. Ultimately, all that was necessary was to clear the DB cache using:

    alter system flush shared_pool;

  • Export as .xls. Classic report type: SQL (body of function from PL/SQL returning the SQL) query

    Hey guys,.

    I'm using version 4.2.6 apex. The theme is 26.

    IM also using Listener Oracle APEX.

    I can print my classic report in PDF or CSV format.

    But I need to export it as a .xls extension.

    Report type: SQL (body of function from PL/SQL returning the SQL) query

    I need is like this cause my 'where' clause type is dynamic.

    Look at using this method: Tom's Blog: a non-standard export excel 2010 (.xlsx)

    I do something similar for downloads to excel in my projects...

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

  • Help with an Export on a classic report 4.2.5.00.08

    Version: 4.2.5.00.08

    Hello

    I have a classic report using Break formatting (on the first column). When the report is exported, for example, if there are 3 lines that are in this group only the first cell is filled and the other 2 are NULL.

    Like this:

    rpt.jpg

    Users than the State of export, like this:

    rpt2.jpg

    One way to do that was to create a second report without breaking formatting set and fix the terms at a time so that when the "Download" link has been activated the second report, the report without breaking format, would go and download.

    My problem is that I forgot how to set the conditions for that to happen.

    Can someone help me to implement?

    OR

    Now is a way to get the formatting AND data in all cells?

    Can what information I provide?

    Thank you

    Joe

    Joe R wrote:

    I have change the post when you have you answer. A question arose, the download can cause all the filled cells AND formatting break?

    Lol you would perform the calculations super aggregate in the report of export SQL using GROUPING SETS or CUMULATIVE instead of APEX report put break in shape.

  • Sort a hyperlink column in the classic report

    4.2.1

    THM2:

    Hi I have a classic report with a hyperlink column. And I need enable sorting on this. What I did is

    Select '< a href = "somelink" >' | party_name | "< /a > ' party_name party_name table.

    However, I just need to show the hyperlink column in the report. Couple of questions

    1. How can I create party_name-based sorting logic using the updated classic sorting standard? Given that all a hyperlink names begin with < - sorting is random. I added the second party_name column an active by default sort on it, but given that the column can not be shown, is not a good way.

    2. I was wondering if there is another way to sort this classic report hyperlink column as shown in the hyperlink and sorting is enabled on the report?

    Thank you!

    ryansun wrote:

    Hi Fac586 - Yes, the requirements are not of the same report. We have several pages with the same type of aspect, however, some of them have a different feature. In this case, Yes, I too simplified it so that easier to understand. I use the hyperlinks on query sql rather that the link of the column is because we have about 5 unions in this query from different sources and each of those interviewing him, having a hypertext link and additional formatting like "BOLD", color etc, under certain conditions. Query1 will return only the party_name, the second query United would have hypertext links, the third would fat etc. The union of the request is not made to take into account this feature, but because of the nature of the data.  While the apex feature works very well, the only question I hit is the hyperlink column sorting in a classic report. Where the simplified question. Individual responses, I've had have been very useful and have been applied successfully.

    In this case, the request for a classic report that has column link, how to sort would work it would be on a regular character column.

    Option 1 (deeply inelegant): Generate an HTML comment containing the sort at the beginning of the column value. The value must be sortable using the character comparison semantics, so dates must follow the format YYYYMMDD, numbers padded to the same length with zeros etc: Re: problem with the Date command

    Option 2A: Expand the Expression HTML technique described in your previous thread (marking dynamically of columns in a "BOLD" for the highest value report) to include the tags.

    Option 2b: Use the HTML Expression technique described in the previous thread to include custom data attributes and use these to add links to dynamic actions.

    If this is done on several pages, and then create a view all the necessary logic and the columns which you can keep it in one place.

  • Default sort of the classic report does not seem to work

    4.2.1

    THM 2

    I have a classic report consisting of an underlying sql with 3 unions. The columns include a party_name (varchar) and two numeric fields.

    for example only select total_cost, cost_to_company, party_name, apex_item.checkbox2(1,party_id)

    (

    Select a.party_id, a.party_name party_name, a.cost_to_company, table a.total_cost when certain conditions

    Union

    Select a.party_id, a.party_name party_name, a.cost_to_company, table a.total_cost when certain conditions

    Union

    Select a.party_id, a.party_name party_name, a.cost_to_company, table a.total_cost when certain conditions

    )

    In our real-world scenario, these three applications are on different tables and different even if some elements are all the same (including the type of data, etc.), where the union

    Because I need activate sorting using the report attributes. I put the tri reporting attributes such as 1 - total_cost desc, 2 - Party_name growing.

    However, when we run the report, if the total_cost for different parts is 0, the sorting should be based on party_name. That does not seem to happen. It still sorts out randomly. I'm wonderingm if it's because there are trade unions and no order of in the query.

    No idea how to solve this problem?

    Nothing to do with unions.

    It looks like it is connected to your thread previous marking dynamically of columns in a "BOLD" for the highest value report. Is it? If so, where are the links generated to conditionally and other HTML elements? They are more likely to cause sorting problems. Instead of posting question after question about one aspect of the problem after another, you get a solution much faster together by creating an example on apex.oracle.com and specifying the complete requirements.

  • How to get the checkbox value when value list changed in the classic report

    Hello
    I worked with apex 4.2 and I create normal classic report with a checkbox column and a single column change to select list (named loved) now, when I want change to user list
    take the value of the checkbox element and display it in the message.

    SQL for the report

    {
    SELECT
    "" "< INPUT TYPE ="checkbox"NAME ="f01"VALUE =" "
    || SEQ
    |'">"SEQ, "
    ID,
    DEPT_NO,
    EMP_NAME} I change the column attributes of Dept_NO to display as the selection of the name of the Department (named lov) list.

    now, I want when change of user name of the Department, the value of the MESSAGE ALERT SHOW IN SEQ

    I create JavaScript on the page

    function test (pThis) {}
    var f01_value = $('select[name="f01"]').value;

    Alert ("#SEQ:" + f01_value);

    }
    < /script >
    I call this javascript function when the change in the list, but the value undefined...

    My Question:

    How can get this value or any value of the point in reports

    concerning
    Ahmed

    Hello
    Check your page now.

    As mentioned earlier, you must use APEX_ITEM. CHECKBOX2.

    APEX_ITEM.CHECKBOX2(2,EMP.EMPNO,null,null,null,'f02_'||lpad(ROWNUM,4,'0')) NO,
    

    And the javascript function will be

    
    

    You cannot use $v to get the value of the checkbox element such that it works differently for the boxes, see http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/javascript_api.htm #BGBGDGIH.
    Therefore, you use the jQuery val().

    See you soon,.

  • Checkbox in classic report

    I have question about the classic report box.

    I need to choose only a single checkbox on each line, hot to ensure that single checkbox can be checked at the same time?

    Boxes are defined in the SQL query in the form:

    apex_item. Also clear CheckBox(1,MSISDN,'UNCHECKED'),
    apex_item. CheckBox(2,MSISDN,'UNCHECKED') as to_analysis,
    apex_item. CheckBox(3,MSISDN,'UNCHECKED') as to_barring

    Here is the picture:
    http://www.deviantpics.com/images/mNgGR.jpg


    TNX!

    change your api calls to add the onclick event for each column in the box

       apex_item.checkbox(1,msisdn,'UNCHECKED onclick="chkckbox(1,this);"' ) as clear,
       apex_item.checkbox(2,msisdn,'UNCHECKED  onclick="chkckbox(2,this);"') as to_analysis,
       apex_item.checkbox(3,msisdn,'UNCHECKED  onclick="chkckbox(3,this);"') as to_barring
    

    Create a javascript function in your page header > Javascript

    function chkckbox(pId, pThis) {
    //get current row index
        var currIndex = $('input[name="f0'+pId+'"]').index(pThis);
         if (pThis.checked) {
       //simply uncheck other check boxes
              if (pId == 1) {
                   $('select[name="f02"]')[currIndex].checked = false;
                   $('select[name="f03"]')[currIndex].checked = false;
              } else if (pId == 2) {
                   $('select[name="f01"]')[currIndex].checked = false;
                   $('select[name="f03"]')[currIndex].checked = false;
              } else if (pId == 3) {
                   $('select[name="f02"]')[currIndex].checked = false;
                   $('select[name="f03"]')[currIndex].checked = false;
              }
         }
    }
    

    Please note that I have not tested this code but it should work, if you have a problem just try to debug by using console.log

  • Classic report limit the number of rows displayed

    Hi all

    In my application, I have a classic report that displays data from a simple query. For layout reasons, I want to limit the number of display 5 instead of the default value 15. I looked in several forums and they told me that I have to set the number of lines in the report attributes.

    But it doesn't have what I want. I'm using APEX 4.1.0 on Oracle 11 G database

    My question is: How can I limit the maximum number of lines in a classic SQL report.

    Hamertje16 wrote:
    I tried already to 5 the number of lines and number of lines (point).

    Do not set anything in number of lines (point). This is used to identify an element of the page containing the number of lines to allow users to control it. Remove * 5 * from here.

  • change the color of line based on the value of column 5 Apex in the classic report

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Hello

    I know this question has been asked several times here, but I'm working on 5 Apex and need to know the correct way to do it in this version.

    I need to change the color of the text of the entire line (no background color) based on the value in one of the columns of the classic report. I have just two conditions, if the value of column = Yes, color should be red, otherwise it must be green.

    I am new to jscript and css, so appreciate if someone can tell me the solution with steps.

    I have already checked this link that changes the value of the column, need to do something similar to the whole line.

    https://tylermuth.WordPress.com/2007/12/01/conditional-column-formatting-in-apex/

    Hi coolmaddy007-Oracle,.

    Here's an example set up on the apex.oracle.com according to the specifications you gave: https://apex.oracle.com/pls/apex/f?p=35467:1

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Here is how it is done:

    Create a dynamic action with the following specifications:

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $('td[headers="JOB"]').each(function() {
      if ( $(this).text() === 'MANAGER' ) {
        $(this).closest('tr').find('td').css({"color":"red"});
      }
      if ( $(this).text() === 'SALESMAN' ) {
        $(this).closest('tr').find('td').css({"color":"green"});
      }
      if ( $(this).text() === 'CLERK' ) {
        $(this).closest('tr').find('td').css({"color":"blue"});
      }
    });
    

    NOTE: Download the selector appropriate for your knowledge $('td[headers="JOB"]') case using firebug/browser development tools.

    Items concerned: leave blank.

    PS: Changed the example to change the color of text instead of the background color.

    I hope this helps!

    Kind regards

    Kiran

  • How to extract values of classic report column in the text element

    Hi all

    I've created a classic report (select id, name,' < input type = "button" value = "add" id = "add" name = "add" > "as" add details "details ;) with a single column as column values want link.i in the text element when I click on the link of that particular record of the report)

    (1) in the link this link column property I've specified the URL as [javascript:insert_in_table(#ID#,#NAME#)]

    (2) text two article P_ID, P_NAME

    (3) in the header of the page, I've specified as javascript

    < script type = "text/javascript" >

    function insert_in_table (id, name) {}

    var regId = ' #detail #'.substr (1);

    var req = new htmldb_Get (not null, $v ('pFlowId'), 'APPLICATION_PROCESS = add', $v('pFlowStepId'));

    Req.Add ('P_ID', ID);

    Req.Add ('P_NAME', Name);

    forced. GetAsync (function () {}

    If {(p.readyState is 4)

    $a_report (regId);

    }

    });

    }

    < /script >

    (4) created a (add) process whose point: on demand, run this process when requested by ajax

    pl/sql: insert into name_detail (id, name) values (: P_ID,: P_NAME)

    now the problem is I m not getting the values of column in the report in the text element, it only shows white.

    Kind regards

    Ketan

    Hello Ketan,

    Assuming that you want to insert the values into the table, this is why you want to set values for the element,

    If this is the case, then no need to define values for the element to insert.

    Follow the steps below, it is one of the embodiment of your condition.

    Step 1: Put the code below in your classic report query

    assuming that the id is of type number and the name is of type varchar, that's why I am attaching the name to apostrophe, see line 3

    select id
         , name
         , ''  as "Add to detail"
    from detail
    

    Edit 'Add details' column-> column attributes-> view-> column of Standard report

    Step 2: Create a process in the processing of the Page

    Name: INSERT_DATA

    Address the point: on demand, run this process when requested by ajax

    Process: putting the code below

    Declare
      P_ID number ;
      P_NAME varchar2(50);
      Begin
          P_ID   := apex_application.g_x01;
          P_NAME := apex_application.g_x02;
          insert into name_detail(id,name) values (P_ID,P_NAME);
    End;
    

    Step 3: Create a java script function to call your insert ajax process.

    Change the Page-> the function and the global variable declaration-> put the code below

    function insert_in_table(id,name) {
      apex.server.process ( "INSERT_DATA", {
          x01: id,x02: name
      }, { success: function( pData ) { }
      });
    }
    

    Hope this helps you,

    Kind regards

    Jitendra

  • Bug in the classic report based on the function?

    A simple example, suppose I want a classic report in which I can change the sort field by selecting in the P1_SORTFIELD element. Apex 4.2, I was able to implement the report using the PL/SQL function

    return "select ENAME, SAL from EMP by | : P1_SORTFIELD;

    I can't do that in Apex 5 on my workspace apex.oracle.com. I either get a runtime error "SQL command not completed property" if I use generic column names, or 'not all variables' if parse error I do not have.

    My real application use generic column names, so I am more interested in a solution to this.  For example, I tried to create a report with the source

    return "select ENAME from EMP by ENAME;

    If I run using the generic column names I always get the runtime error "command SQL not successfully completed.

    Is this a bug?

    Ed Sciore

    Hi Ed,

    I ran your application in debug mode and displays the following error output.

    show report
    determine column headings
    
    ...Execute Statement: select ENAME, SAL from EMP order by ename
    order by 1 nulls last
    
    Logging exception:
    Sqlerrm: ORA-00933: SQL command not properly ended
    Backtrace: ORA-06512: at "SYS.DBMS_SYS_SQL", line 1445
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 464
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 475
    ORA-06512: at "APEX_050000.WWV_FLOW_DYNAMIC_EXEC", line 411
    

    See the other "order by null 1 last" that is added to your statement. This is what the origin of the problem. The additional order by is caused by the "Sortable" indicator enabled for your columns. If you disable the sort, because will work you who control in your SQL statement in the report well.

    I'll take a look tomorrow, if we had a different behavior in 4.2 to automatically disable these flags and how it is actually easy to determine safe at the time of the design that your pl/sql function returns a SQL statement with an ORDER BY clause.

    Concerning

    Patrick

    Member of the APEX development team

  • "Character String Buffer too small" classic report Apex 3.2.1

    Hi all

    I know it's a very old version I mention here, but that's what we have in our environment, would be very grateful if anyone can help out.

    I have a classic report with the sub query in this, I have added a filter using an element from the selection list (P70_GROUP).

    SELECT VWS. ServerID AS Display_ID, vws. ServerID AS ID, vws. Host name, vws. ServerStatus, vws. SiteName AS Site vws. Customer, vws. CoreHours, vws. Patch_Notes, vws. PATCH_DEP, vws. Patch_Day, vws. PATCH_GROUPID, vws. PATCH_TIMEID AS VW_Live_Support FROM Time LEFT JOIN W_Patch_Groups wpg vws WE (vws. Patch_GroupID = wpg.ID) WHERE the vws. ID = ' no AND NVL (wpg. Ignore, 'n') = ' n AND ((: P70_GROUP > 1 AND vws.)) PATCH_GROUPID =: P70_GROUP) OR (: P70_GROUP = 1 AND vws.) (Patch_GroupID IS NULL) OR (NVL(:P70_GROUP,0) = 0)) AND (INSTR (UPPER (vws. Host name), SUPERIOR (NVL (: P70_SEARCH, vws.)) HostName))) > 0 OR INSTR (UPPER (vws. ServerStatus), SUPERIOR (NVL (: P70_SEARCH, vws.)) ServerStatus))) > 0 OR INSTR (UPPER (vws. SiteName), SUPERIOR (NVL (: P70_SEARCH, vws.)) SiteName))) > 0 OR INSTR (UPPER (vws. (Client), SUPERIOR (NVL (: P70_SEARCH, vws.)) Customer))) > 0 OR INSTR (UPPER (vws. CoreHours), SUPERIOR (NVL (: P70_SEARCH, vws.)) CoreHours))) > 0 OR INSTR (UPPER (vws. Patch_Notes), SUPERIOR (NVL (: P70_SEARCH, vws.)) (Patch_Notes))) > 0)

    This is when I select a group in the list, I get

    "error report:

    "ORA-06502: PL/SQL: digital or value error: character string buffer too small.

    an unusual thing, that I've noticed here is when I select "All groups", which returns the value 0, it is works well and return of 3700 lines but when I select any group that returns 10 to 20 lines I get the above error.

    does not include why it is, please help me.

    Kind regards

    Tauceef

    Hi all

    I am able to solve the problem by referring to the link below:

    Huge selection box fails...

    What I am able to solve without even changing the item type. Things are working fine now, but it would be really helpful if someone could give me their expert commentary on the solution above.

    Is this feasible? I'll be able to solve the problem forever, or it will cause problems again in the future?

    Kind regards

    Tauceef

  • Functionality of the classic report checkbox column.

    My requirement is

    I have a classic report based on sql query in this 1st column is checkbox.

    When I click on this check box, the value of the 2nd column is copied in the 4th column of the same rank.

    Assume that the 2nd column value is 100 after you have clicked on the box of 100 control is copied into reports even line 4 column.

    How can I do this?

    You want to just copy the value of the of the sal to the text box column. Its simple javascript.

    Looking at your page source I see that you call a function called spCheckChange. You use an application process in this function. Is this really necessary? The result is a heavy AJAX call.

    You can simply use jQuery, if you create your report the right way i.e. add attributes to the checkbox and textbox which serve to identify which box would copy a value in what text box.

    Here is a demo that I put in place.

    https://Apex.Oracle.com/pls/Apex/f?p=53154:3:108154269628013:no

    username: public_user

    password: demo

    You can take a look on how javascript code and attributes of the text box/box using your browser tools.

    Kind regards

    Aalami

    Please check the response as helpful or correct if you find it then. Thank you!

Maybe you are looking for

  • Norton Toolbar with Identity Safe is not compatible with Firefox 10.0. He is disabled and cannot be enablesd. What should do?

    I updated Firefox to v. 10.0. Since then, my Norton toolbar is disabled. I relays on Norton Identity Safe to browse the web and protect my password. Now, unless I can get it working again, I stop using Firefox and come back to "the other browser. I u

  • What's new in point 7.2 of Skype?

    What's new in point 7.2 of Skype? I see no difference... yet.

  • Battery for my Satellite L20 - 217

    Hello I'm looking for a stronger battery for my L20-217 the current... .lasts (max) 01:30 hrs I was looking for battery options and found "PA3420U-1BRS. will it be--> PA3420U-1BRS... be compatible with my laptop? Thank you! Ravindra

  • How to solve error 50103

    Dear all I'm trying to collect data from two sensors. The two sensors ouput is similar tension. My goal is to acquire data from two sensors can trace their waveforms, multiply the two waveforms and get the FFT. The error that is 50103. The image of t

  • Officejet6600: HP6600 poor print quality

    Hello I'm contiinually having to perform the function of print head cleaning before I can print with my Officejet 6600. Once the cleaning is finished, the print quality is fine. Before market more printing is smudged, blurred, or missing, and is ofte