(Updated report) SQL query

Is it possible to convert an existing SQL query report area to an "application SQL (editable report)? If not, where should we do to create a SQL (editable report) region?

I had the same problem.

The way I ended up converting my sql to a (editable report) SQL query was:

Create a new page with the type of form and tabular presentation, run through all the steps required Wizard.

Once done, you can go back and modify the report and paste in your original sql code.

Worked for me.

It will be useful.

Jen

Published by: munsej on August 7, 2009 08:42

Tags: Database

Similar Questions

  • (Updated report) SQL query - may not know how to make one

    Hi people,

    Can someone tell me how to make a report where the data can be updated? Not an interactive report, SQL report that selects a single row. The only options in the menu dropdown I see are "SQL query" and 'SQL Query (body of function from PL/SQL returning SQL query)', but I have a report elsewhere that says: this type are "SQL Query (updated report)", but I do not remember how :(

    Thank you very much

    -Adam

    Hi Adam,.

    An updated report is a 'tabular form' - see: http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/frm_tabular.htm#CHDFBHDB

    Andy

  • What line has been activated in a (updated report) SQL query?

    I have an app with a report based on a query SQL (PL/SQL function...) defined on the Global Page.

    I want on the pages where the report is used, click on a particular column (TCKT_ID), and then pass the values of this line to another page for treatment.

    I would like to know things:

    (1) how to determine which line clicked?  The column is TCKT_ID and it is used as a link to another page.  The SQLis a significant (for me!) join the tables.

    (2) how to see the values of other columns in the same row?  Because I format with 'div', columns are named - no "f02", of "f03", etc.

    (3) how to pass multiple values (ENAME, JOB, MGR, SAL, COMM) to the target page?  You might ask: why not just re - query data using a unique key.  Great idea, but the unique key is four columns if I still need a way to pass these four values for this unique key.

    I built a 'pretty close' example of the situation in the present case:

    WS APEX_EXAMPLES_01

    Demo / demo

    Application: Line Info 10782 - Page 0 has the report.  Page 1 poster with a link (in red) on page 2.

    I think I can fill most of what I need if someone can just show me how to make, say, the ENAME of the line clicked on page 1, so I can use it to filter the query on page 2 for just this line clicked on page 1.

    From < tt > < /tt >, I tried show the actual line view - Source of the actual report than just let me but it comes out like this

    M F

    MM_O_BD_DAILY. CTL (D046 ftp) CMM_O_BD_DAILY.sh (ftp D046) 17:15

    10-13 JUNE AT 17:00:52
    10-13 JUNE AT 17:00:53

    17:15

    10-13 JUNE AT 17:00:52
    10-13 JUNE AT 17:00:53

    17:00

    10-13 JUNE AT 17:00:59
    10-13 JUNE AT 17:01
    THERE

    ARS003_TEST NEXT BUSINESS DAY

    I wonder if I'm not understanding something. This seems to be a very simple thing to do without 'tricks '.

    Take a look, I modified the column LINKING_NUMBER of the report of p0.

    Basically, you specify only the fields you want to fill and their assignments.  I added 4 fields of destination on p2 to receive assignments.  Then you can do whatever you want with them as editing a report, etc...

    The only trick here is to get more than 3 elements in the URL, you must change your Page link type in this URL request.  You can specify lost elements in this way.

    Thank you

    -Jorge

  • (Editable report) SQL query with line selector

    I used this code to get the update of the records in a query SQL (editable report).
    Updates a value in a selection box.

    because me in 1... apex_application.g_f01. Count
    loop
    UPDATE CONTRACTS
    SET LOAD_FLAG =: P8_SELECT
    WHERE ID = apex_application.g_f01 (i); -i'the checked the file 'primary key '.
    end loop;

    Here's my dilemma.
    Line selector seems to be in a fixed position.
    By linking the line for identification number selector (1, 2, 3, etc.)
    Sort by ID (1, 2, 3, etc.)
    It works perfectly, as long as the ID is sorted in order. < <
    If it is sorted by another field with say ID 29 now in the 1st row, by checking the box and update, you update ID #1 located elsewhere on the page.
    Any ideas how to make the line selector literally equal to the line, it is displayed in?
    Thank you
    Bob

    I think I have an idea of what is wrong and, eventually, how to fix it. Try this:

    make your field primary key (NO ROWID!) in a column in a table column, either through the "wizard" (i.e. through the report attributes screen), or using the APEX_ITEM api (as described by Vee). I often have my primary key as a hidden; If you really need to see it, you can use "DISPLAY_AND_SAVE".

    So if your primary key 'ID' colum is now in the 2nd table as a table (i.e. f02 - adjust accordingly!), your PL/SQL process should look like this:

    for i in 1 .. apex_application.g_f01.count
    loop
       UPDATE CONTRACTS
          SET LOAD_FLAG = :P8_SELECT
        where ID = apex_application.g_f02(apex_application.g_f01(i)); 
    
    end loop;
    

    It of a little confusing at first but it it makes sense when you train how tabular tables work with check boxes. The length of this array represents only what is verified - so if you have 3 values checked, the cardinality of the table in a particular table 3. On the other hand, your other tabular berries (containing the 'normal' values) has a cardinality of the count of all the visible lines.

    In this case, the record selector (F01) contains the ID of the relevant line in your report - so passing this value in the array index 2 (F02) should give you the correct primary key for that particular line value. If you subsequently order the report by another field, it should work again.

    I should add that Vee method will work well - the difference is that, instead of organizing the rowid, f01 contains the actual key value. Hope this helps

    Published by: Joel_C on March 21, 2011 11:50

  • Report, SQL query based on the values of the elements (question SQL)

    Hello

    I use APEX 4.0 with Oracle 10 g r2 under Windows XP Pro SP3.

    I have an interactive report and a menu with a few items to filter the report.

    It works with most of the elements, but my problem is to select lists that have additional values, for example:
    SELECT '(null)' display_value, 'NULL' return_value FROM DUAL
    UNION ALL
    select distinct(SPAT_AREA_NAME) display_value, SPAT_AREA_NAME return_value 
    from SPATIAL_POINTS
    order by 1
    and I will return null as ' (return '%').

    For example, if the user selects "(null)", the report should return all rows with a NULL value in the column AREA_NAME.
    If he chooses "", the report should return all the lines. "
    and if the user selects a value, the report should return all the lines containing the value in column AREA_NAME.

    I don't know how to build my application. I tried with the CASE statements, DECODE, etc... but I still can't!

    My report query is for now:
    select SPAT_ID,
     SPAT_ACCL_NAME,
     SPAT_AREA_NAME,
     SPAT_CLASS,
     SPAT_NUMBER,
     SPAT_PT,
     SPAT_TYPE,
     SPAT_STATUS,
    from SPATIAL_POINTS 
    where 
     upper(SPAT_AREA_NAME) LIKE upper(:P3_FILTRE_AREA_NAME)  AND
     upper(SPAT_ACCL_NAME) LIKE upper(:P3_FILTRE_ACC_NAME) AND
     upper(SPAT_CLASS) LIKE '%'||upper(:P3_SPATIAL_CLASS)||'%' AND
     instr(upper(:P3_SPATIAL_TYPE_VALUES),upper(SPAT_TYPE)) > 0 AND
     instr(upper(:P3_SPATIAL_STATUS_VALUES),upper(SPAT_STATUS)) > 0 AND
     instr(upper(:P3_SPATIAL_POINT_VALUES),upper(SPAT_PT)) > 0
    Any idea?

    Thank you!

    Yann.

    Hello

    Then, assuming that spat_accl_name is not a string value "NULL" then you can try this...

    SELECT spat_id,
           spat_accl_name,
           spat_area_name,
           spat_class,
           spat_number,
           spat_pt,
           spat_type,
           spat_status,
           ROUND(spat_cumul,
                 (SELECT up_number_precision
                  FROM   user_preferences
                  WHERE  UPPER(up_nice_login) = UPPER(v('APP_USER'))))
              AS "SPAT_CUMUL"
    FROM   spatial_points
    WHERE  :p3_filtre_acc_name IS NULL AND spat_accl_name IS NULL
           OR(CASE
                 WHEN :p3_filtre_acc_name = '%' THEN NVL(spat_accl_name,'NULL')
                 ELSE :p3_filtre_acc_name
              END = NVL(spat_accl_name, 'NULL'))
    

    See you soon

    Ben

  • DA on updatable report items Sql query using the class

    Request Express 4.2.5.00.08

    10-11 g Oracle

    I have a page, so it has a link/button when he clicks then modal region will appear. Modal region has a as a table (Type SQL Query (updateable report)). All work very well so far.


    However, I've now added some complex things.

    for example. My region is based on the query of SQL Type (editable report).

    SELECT id, name of family, Traghetti, area, d_date, start_time, End_time, displacement, role of table where id =: P10_ID;

    I can also add a new line of course.

    My problem is, (point) Shift display based on the value of Start_Time point) and so I made sure the class for two items.

    for example, Start_Time (' class = "st_tm" ') and Maj ('class to = "Shift_time" '). Start_Time is based on (LOV) and shift is off the point in the sql query, but change the Start_Time.

    And now, I created the DA.

    1. event: change

    Selection type: jQuery Selector

    jQuery Selector: .st_tm

    Condition: No.

    1. action: set value

    Set type: Expression Javascript

    The JavaScript Expression: $(this.triggeringElement) .val ();

    The element affected: P10_X1 (it is a hidden item)

    2. action: Plsql Code

    Code: start to null; end;

    Page items to submit: P10_X1

    3. action: Plsql Code

    Code: start

    If: P10_X1 between '03' AND '11' then

    : P10_X1: = 'EARLIES ';

    elsif: P10_X1 then '12' and '18'

    : P10_X1: = 'LATES ';

    on the other

    : P10_X1: = 'NIGHTS';

    end if;

    end;

    Page items to submit: P10_X1

    NOW another DA

    Event: change

    Article (s) P10_X1

    Condition (in list)

    value (HASTY, LATES, NIGHTS)

    Action:

    Set type: Expression Javascript

    The JavaScript Expression: $(this.triggeringElement) .val ();

    Affected item:

    Selection type: jQuery Selector

    jQuery Selector:. Shift_time

    Well, I look forward all the above work well, but I'm having a problem.

    If I have more than 1 lines on a modal region and if I change the Start_Time value for a row then MAJ (point) is changing but he effect on all lines.

    I want, if I make the changes on the line line # 2 while only 2 # MAJ (point) must be not performed any other lines?

    Help, please!

    Kind regards

    RI

    I found the solution me thank you.

    I removed all the DA mentioned above and created a new.

    1. event: change

    Selection type: jQuery Selector

    jQuery Selector: .st_tm

    Condition: No.

    Scope of the event: dynamic and light on page load.

    Action (Javascript code)

    ROW_ID = $(this.triggeringElement).attr('id').substr (4);

    If ($(this.triggeringElement). val() > = 03 &. val() $(this.triggeringElement))<= 11)="">

    .Val ('EARLIES') $(«#f11_» + row_id);

    }

    ElseIf ($(this.triggeringElement). > 11 val() & $(this.triggeringElement). val())<= 18)="">

    .Val ('LATES') $(«#f11_» + row_id);

    }

    ElseIf (. val() > $19 (this.triggeringElement)) {}

    .Val ('NIGHTS') $(«#f11_» + row_id);

    }

    also created another DA because I have a disabled report items.

    Event: before the page is sent.

    $('_:_disabled').removeAttr ("disabled");

    and finally created manual process of DML for tabular and everything works fine. (Insert, Update, and delete).

    Kind regards.

  • Report of update SQL query with line selector. Update process.

    I have a report of update SQL query with the selectors in line.
    How to identify line selector in a process update on the page.

    I want to update some columns with a value of an area of selection on the page.

    With the help of the base:

    UPDATE table_name
    SET Column1 = value
    WHERE some_column = some_value

    I would need to do:

    UPDATE table_name
    SET column1 =: P1_select
    WHERE [line selector] =?

    Now sure how to identify [line selector] and/or validate it is checked.
    Thank you
    Bob

    Identify the name of the checkbox of the source of the page element, it should be of the fxx format (f01, f02... f50).
    Suppose that we f01.

    for i in 1 .. apex_application.g_f01.count
    loop
      UPDATE CONTRACTS
      SET SIP_LOAD_FLAG = :P16_STATUS
      where  =  apex_application.g_f01(i); --i'th checked record' primary key
    end loop;
    
  • Validation of a region defined as a QUERY SQL type (updated report)

    Hello

    I am trying to perform validation on a region defined as type of QUERY SQL (editable report). The report has two columns.
    One of the columns is a Select list and I want to make sure that the user can select the same value twice
    in the report. For example, if the selection list has 5 values A, B, C, D, E, I don't want a user to be able to select
    B twice in the report. Will it use javascript to perform validation? If Yes, could someone provide some guidance on
    where to embed the javascript? Are there other alternatives than javascript? I create an element that came from a sql query
    counts the number of lines where the value of the column is the same. I then used the item in my validation logic. The problem with this logic
    is that a user can enter the same value and it is not until the 3rd attempt to select the same value that the validation works using the number of lines which is why I think that I need to somehow capture the value of the selection list when a user selects and then compare it to what is already in the database column Select.

    I hope that my question and explanations are clear.

    Thanks in advance for your help,

    Michael

    Hello

    This can be managed using javascript or a validation of the page. Here is an example of use of javascript: [http://htmldb.oracle.com/pls/otn/f?p=267:7]

    To do this, I have:

    1 - a model of button which does not send the page but just runs javascript. The model will depend on your theme, but should include:

    <a href="#BUTTON_ATTRIBUTES#">#LABEL#</a>
    

    If #BUTTON_ATTRIBUTES # appears on the template, delete it as we need it only once. You must create a new button model based on a copy of your existing across models, shared components. Normally, he would show href = "" #LINK # "-we do not want that this would become doSubmit('buttonname')." If your model does not use tags for buttons, you might need to create one from scratch.

    2 - I have updated the button on my page to use this template and then assign the setting button attributes:

    javascript:check();
    

    3. in the header of the HTML page, I added:

    <script type="text/javascript">
    function check()
    {
     var e = 0;
     var f = document.getElementsByName("f02");
     var k1;
     var k2;
     var v1;
     var v2;
     if (f)
     {
      for (k1 = 0; k1 < (f.length - 1); k1++)
      {
       v1 = f[k1].value;
       for (k2 = (k1 + 1); k2 < f.length; k2++)
       {
        v2 = f[k2].value;
        if (v1 == v2)
        {
         e = 1;
        }
       }
      }
     }
     if (e > 0)
     {
      alert("Duplicates found!");
     }
     else
     {
      doSubmit("SUBMIT");
     }
    }
    </script>
    

    In this example, SUBMIT is the name of the button and "f02" is the name attribute of the select list items that we want to check - change these needs by your page.

    Now, when the Submit button is clicked, instead of directly submit the page, the javascript function is called. This function loops through each selection list and gets its value. Then, he compared it to the remaining items. If there is a match, the e flag is set to 1. After all the items have been verified, if e is not 0, then a message appears. Otherwise, the page is sent.

    Andy

  • Validation of a column in a query SQL-tabular form (updated report)

    Hello

    I have a tabular form on a table of type SQL Query (editable report). Users can modify/add lines to the table through the form. I would like to have some sort of validation on each column of the report form. Is there a way I can do it by their SUMMIT. Please note that I did not manually create this form... just use the tools in the APEX. Thank you.

    Sihem

    In the same way.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

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

  • More than 1 SQL query with checkbox and error invalid number report

    Hi all

    I have two SQL query reports that each has an apex_item.checkbox and two processes for each report.  A report/process works very well.  It gives me an error of invalid number.

    In addition, another query SQL (editable report) gives me the following error when using the Multi line process, delete.

    ORA-06502: PL/SQL: digital or value error: character number conversion
    error ORA-06502: PL/SQL: digital or value error: character number conversion
    error
    Ok

    When I got a report from SQL query (with box and a process) and the query SQL (editable report) everything worked.  It stopped working when I added another SQL query report (with box and a process).

    A SQL query has the following in my query: apex_item.checkbox(3,email_id,'UNCHECKED') ""

    The other SQL query has the following: apex_item.checkbox(2,b.file_id,'UNCHECKED') ""

    Any help will be greatly appreciated,

    Sylvia

    Hi Reema,

    I've recreated the region and now it works!

    Thank you for this, looking at

    Sylvia

  • 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

  • Top of page justify/format vertical on a region of SQL query report

    I have a simple region report, type = SQL query.  One of the selected columns is an address in the format which the syntax is shown below:

    RTRIM (address_line1| ) "< BR >" || address_line2 || "< BR >" ||

    address_line3 || "< BR >" || address_line4 || "< BR >" , "< BR >" )||

    "< BR >" || City || ', ' || State || ' ' || Zip_code

    It works very well, but he's justifying the vertical center, as is the title of the column.  I need both the selected value and the title of the column to be justified high vertical.  All the other selected columns are the only line, but it is the only multiline select.

    Suggestions on how to achieve this?

    Apex v4.2.1.00.08.

    Uncle Buck says:

    The theme used is "dark blue - 16.

    Not a good thing. Very outdated and buggy. Is it a legacy application or one that is (somehow) must take in charge users who use IE6 (or compatibility modes it)? If this isn't the case, strongly recommend that you spend a theme of APEX 4.x standards mode as soon as POSSIBLE.

    It would be hard to create a new model, because this model is used by a lot of pages in this application, and they need to all be like.

    To get cells aligned at the top using inheritance default: vertical report, watch 1 (exclude null columns) model report in the page CSS Inline property, use the following:

    .vertical1 td {
      vertical-align: top;
    }
    

    However, I would recommend moving away from using inherited as 'Dark blue - 16' themes and models of integrated by default report. Standards mode APEX 4.x themes and thematic reports patterns will give best results with current browsers.

  • SQL query for the apex report

    Hi team,

    For example if I have a demo table with 4 columns (A, B, C, D) DEMO.

    I want a report on this table, such that the report contains the headers and the Details section.

    For each unique combination of (A, B) I must first of all show header based on the header information I want to display the detailed section.
    In my header section I want to display 2 columns (A, B) that are common to the detailed section. Remaining 2 columns in the detailed section.


    Here is an example: -.

    A B C D
    1 5 9 3
    1 5P8
    1 5 P O
    1-5-9
    1 8 9
    1     D     *     /
    2 8 33 P
    2 P O O
    2 P L L

    YOU WILL SEE
    A AND B
    1 5

    C D
    9 3
    P 8
    P O


    A AND B
    1 D

    C D
    5 9
    8 9
    *     /



    A AND B
    2 P

    C D
    8 33
    O O
    L L

    Please suggest the solution (sql query) for above the problem and how to nest gernerated headers dynamically in the report area.
    I use APEX 4.0
    Any position in this regard is very significant.

    Thanks and greetings
    Rajendra

    Try this:

    SQL> select * from tab;
    1 5 9 3
    1 5 P 8
    1 5 P O
    1 D 5 9
    1 D 8 9
    1 P 8 3
    1 P O O
    
    7 rows selected.
    
    SQL> select a,b from
    (select r,a,b from
    ( select to_char(rownum)||'a' r, 'A' a,'B' b from
            (select distinct a, b from tab order by a,b))
            union
    ( select to_char(rownum)||'c' r, 'C' c,'D' d from
            (select distinct a, b from tab order by a,b))
    union
    ( select to_char(rownum)||'b' r, a,b from
    (select distinct a, b from tab order by a,b))
    union
    select parent.r, tab.c, tab.d from
    ( select to_char(rownum)||'d' r, a,b from
    (select distinct a, b from tab order by a,b)) parent ,
    tab
    where parent.a=tab.a and
    parent.b=tab.b
    ) order by r
    ;
    A B
    1 5
    C D
    9 3
    P 8
    P O
    A B
    1 D
    C D
    5 9
    8 9
    A B
    1 P
    C D
    8 3
    O O
    
  • Report with the sql query area

    Hello

    I have a region in relation to the sql query. There are two regions in the page. Top of page, the user enters data and after that second data enterd to see the region, which is related region
    based on a sql query.

    Now, when this page is opned, because the user has not entered anything, region report shows the message "no data found". Is it possible to remove this message or
    may I have conditionally disaply region report IE if data are inserted only region report is dispalyed.

    Thank you

    Hello

    You can use conditions for example "Exists (SQL query returns at least one row).

    Kind regards
    Jari

Maybe you are looking for