Do stuff to PL/SQl that returns the value and redirect to modal page by setting this value

Hello

a button click Page1 I would perform a PL/SQL procedure that returns a value in P1_ITEMVAL and then redirect to a page 2 (modal page) and the value of an item on this page with the value previously returned. To do the same thing with a normal page is quite easy:

Button action is present, then process of PL/SQL that returns the value in the P1_ITEMVAL element and, finally, a branch at page 2 that sets P2_ITEMVAL with P1_ITEMVAL. I really have no idea how to do the same thing when the target is a modal page.

I created a unit test on https://apex.oracle.com/pls/apex (application 1554 - redir_to_modal)

Workspace: tests

USER: supporter

PWD: supporter1234

Any help would be much appreciated.

Kind regards

Pavel

Pavel

If you prepare a URL using the value calculated in the PLSQL of DA part you can then use a subsequent stage of javascript to set the location of the window.

This will jump to the top of the page of the modal dialog box

: P1_URL: = apex_util.prepare_url)

' f ? p ='|| : APP_ID - Application id

|': 2' - Page id

||': ' || : APP_SESSION - Session id

||':'                      -- Request

||':NO'                    -- Debug

: ': ' - Clear Cache

: ': ' - Settings

||' P2_ITEMVAL'

: ': ' - Parameter values

|| (: P1_ITEMVAL);

then in the action of javascript

Window.Location.Replace ($v ('P1_URL'));

Hope this is of some use

Concerning

Kelvin

Tags: Database

Similar Questions

  • I'm writing sql that uses the value of a form element to calculate the value in the element anothet.

    Hi, I have a form that contains a single reference, name of the partner and three values. I am trying to add a new element that adds the three values based on the ID and displays the result.

    It's the sql which I use and it works if I type in a value for the ID fix, but when I replace it with 'P5_ID' I get the error below when the form is used. I can save the changes to the page OK.

    I would appreciate help with this.

    Thank you

    Steve

    Select

    ("Data_PSDM_Fcst". "' Month1_Act ' + 'Data_PSDM_Fcst '. "' Month2_Act ' + 'Data_PSDM_Fcst '. (' "Month3_Act") as "QT4.

    of 'Data_PSDM_Fcst' 'Data_PSDM_Fcst '.

    WHERE ID = P5_ID

    ORA-00904: "P5_ID": invalid identifier

    SteveKerry-Oracle wrote:

    Hi, I have a form that contains a single reference, name of the partner and three values. I am trying to add a new element that adds the three values based on the ID and displays the result.

    It's the sql which I use and it works if I type in a value for the ID fix, but when I replace it with 'P5_ID' I get the error below when the form is used. I can save the changes to the page OK.

    I would appreciate help with this.

    Thank you

    Steve

    Select

    ("Data_PSDM_Fcst". "' Month1_Act ' + 'Data_PSDM_Fcst '. "' Month2_Act ' + 'Data_PSDM_Fcst '. (' "Month3_Act") as "QT4.

    of 'Data_PSDM_Fcst' 'Data_PSDM_Fcst '.

    WHERE ID = P5_ID

    ORA-00904: "P5_ID": invalid identifier

    To use a value of element in SQL or PL/SQL of APEX block, use a reference variable to bind that precede the name of the element of the colon ("": "):

    select
        ("Data_PSDM_Fcst"."Month1_Act" + "Data_PSDM_Fcst"."Month2_Act" +"Data_PSDM_Fcst"."Month3_Act") as "QT4"
    from "Data_PSDM_Fcst" "Data_PSDM_Fcst"
    Where ID = :P5_ID
    

    I also highly recommend that you stop what you are doing now, remove all database objects that were created with identifiers respecting case-sensitive and re-create them according to standard practical Oracle so that they are case-sensitive. By the database SQL language reference:

    Note:

    Oracle does not recommend the use of identifiers in quotes for the names of database objects. These city identifiers are accepted by SQL * Plus, but they may not be valid when using other tools that manage database objects.

    Names of objects sensitive to case and between quotes identifiers will only cause confusion and error.

  • How to set a value that returns the value zero to O

    Hello, I have a xml field that returns null... I want 0 to replace the null value... How do in implementing in shape... pls let me know

    Use
    If set to NULL, it replaces with 0, VAL else displayed.

  • I need a query that returns the average amount of characters from text colum in MS SQL.

    I need a query that returns the average amount of characters from text colum in MS SQL.

    Could someone show me how?

    Sorting, I need of the

    DATALENGTH

    function

  • reload the page when SQL query returns a value

    Hello world

    the title of this discussion may seem strange, but I'll try to explain why I need this:

    A user has the ability to connect on my APEX application. There are several tabs in my application that are visible only if a certain SQL statement returns a value which is not the case by default. The user has also the ability to download a file that is transferred to an external system that analyzes the file and writes the data in the database. During this writing process - which may take several minutes - conditions for some of the tabs to show the will becomes real (-> the query will return a value). When the user refreshes the page manually, the tabs will be displayed. However, I want the tabs will appear automatically when the condition is met.

    Is it possible to refresh the page as soon as the query returns a value? It is perhaps possible to check it on the client side and trigger a refresh of the page when the condition is met. It would be even better if only the tabset has been updated, but refreshing the full page is fine as well.

    Thank you!

    Here is an overview of how it can be done

    This is possible thanks to a dynamic action being performed on a timer.

    View default tabs and dynamic action hide them on loading the page if they are not to be considered

    Create a dynamic action that will execute your query every 5 seconds or more

    If the query returns data, you can use the dynamic action to show your tabs using javascript

  • pl/sql block returning the sql query.

    Hello

    I'm using the apex version 3.2 oracle 10g.
    I use the following return statement inside my report, which is a pl/sql block sql query return.

    declare
    The NEST varchar2 (100);
    Start
    ......
    return "select patient_id_code from t_files_data_exp, including patient_id_code not in the NEST';"

    end;

    How am I suppose to mention the pid within the return stmt I mean with quotes or anything? because the above return stmt gives error
    "1 error has occurred."
    Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. The query cannot be parsed, the cursor is not yet open or a function returning a SQL query returned no value. »


    Thank you

    If is varchar2

    declare
    pid varchar2(100) := '(''61092'',''61093'')';
    ...
    
  • Looking for an example of "function that returns the error text.

    Environment: APEX 3.1.1.00.09 on AIX 5.3

    I'm looking for an example implementation of the posting of the "function that returns the error text.

    I would like to write a database function that does the validation logic and return the text of the error.

    Is it possible to create multiple lines of text of error based on error conditions?

    I'm trying to use it at the end of the input data to go on the set of the 'document' to the entry and highlight all error conditions encountered before the 'document' is subject to additional processing.

    I wrote the function and reference it in a posting as ' validate_stuff (: P3_DOC_SEQ); »

    I have an error message "validate_stuff is not a procedure or is not defined.

    The object is a function, not a procedure. It is defined to return a parameter VARCHAR2 hoped posting if it is not NULL.

    When I run the SQL function * more and spend in a number of documents are returned the correct error messages.

    Any direction is greatly appreciated.

    -gary

    Hi Gary,.

    You must RETURN the result of the function:

    BEGIN
     RETURN validate_stuff(:P3_DOC_SEQ);
    END;
    

    Andy

  • Method that returns the bb::cascades:Application?

    Hi, is there a method that returns the bb::cascades:Application?

    I solved the problem by simply passing the request of my class that needs it. If its solved because there is no such method I think.

  • Script that returns the name of the user

    Hello, I have a fairly complex script that exports the text of an InCopy document. Is InCopy CS3 and is running on a Windows 2003 platform. It would be useful as this script to find out who is the user, that is who runs the export. Has anyone written a script that removed the username and group ads, the OS, or in fact InCopy. The solution, I think, perhaps by calling an external script that queries the operating system and returns this kind of data. Any thoughts on this topic would be appreciated. Thks, Wil

    On Windows, you can get the name of the user like this:

    Alert ($.getenv ("username"));

    or

    alert ((Folder.temp + "") .slice (12, -14));

    Kasyan

  • Function that returns the results of a select statement

    Hello

    I would like to create a feature on the famous HR Departments oracle table to select * from him. I don't know how to do it.

    Is someone can help me?.

    Thank you

    Oracle stored functions cannot return result sets directly but can return the REF CURSOR. Please read [optimize result set retrieval using ODP.NET and Ref Cursor | http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/williams_refcursors.html] which gives complete examples in PL/SQL for the side Server and VB. NET client side.

  • Function that return the name of the current report

    Hello

    Anyone know if there is a function that returns the name of the current report?, similar to GET_APPLICATION_PROPERTY (CURRENT_FORM) in the forms.


    Tnks,


    LEFM

    Hello

    You can use the builtin: SRW. GET_REPORT_NAME
    This function returns the file name of the running report

    http://www.Oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/PLSQL/builtins/SRW/srw_get_report_name.htm

    NOTE: it is not the name of the RDF file. Is the name defined in the reporting name property.

    Concerning

  • ORA-06503: PL/SQL: function returned no value ORA-06512:

    Hi all

    SQL > set serveroutput on

    SQL > CREATE OR replace FUNCTION qty_value (p_item_id number)

    2 RETURN NUMBER

    3 EAST

    4 v_qty_arrival NUMBER;

    5 BEGIN

    6. SELECT THE CASE SENSITIVE OPTION

    7. WHAT (SUM (b.quantity) - SUM (b.quantity_received)) < = 0 THEN 0

    8 ELSE (SUM (b.quantity) - SUM (b.quantity_received))

    9 END Qty_Arrival

    10 INTO v_qty_arrival

    Po_lines_all 11 a,

    po_line_locations_all 12 b

    13 WHERE a.po_line_id = b.po_line_id

    14 AND a.item_id = p_item_id;

    15 EXCEPTION

    16 THEN THAN OTHERS THEN

    17 v_qty_arrival: = NULL;

    18 RETURN v_qty_arrival;

    19 END qty_value;

    20.

    The function is created.

    SQL >

    SQL > select xxc_qty_arrivale (214960) double

    2.

    Select xxc_qty_arrivale (214960) double

    *

    ERROR on line 1:

    ORA-06503: PL/SQL: function returned no value

    ORA-06512: at the 'APPS '. XXC_QTY_ARRIVALE', line 19

    Back AFTER using the exception block is fine as long as your code actually REACHED the exception block.

    When there are no errors, then your code will not enter the exception block, but you still NEED to return a value, since it is what functions a function wants to return a value, that's what the functions are made for.

    Spot the differences between the following 3 functions. Understand how they work.

    The first function has only a return in the exception block but runs correctly. Result: error, because the back is missing in the code block.

    The second function has a return in the exception block and one in the block of code and runs correctly. Result: no error, because the return is not missing in the code block.

    The third function has a return in the exception block and one in the block of code and is forced into an error. Result: no error, because the return of the exception handler is used (instead of retriggering of the error, which you would normally do).

    SQL > create or replace function myfunc

    2 return number

    3 as

    4 start

    5 dbms_output.put_line ('in the section of code');

    6 null;

    7 exception

    8 then than others

    9. can

    10 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    11      --

    12 return 0;

    13      --

    14 end;

    15.

    The function is created.

    SQL > select double myfunc;

    Select double myfunc

    *

    ERROR on line 1:

    ORA-06503: PL/SQL: function returned no value

    ORA-06512: at "GHPLUS. MYFUNC", line 14

    In the section of code

    SQL > create or replace function myfunc

    2 return number

    3 as

    4 start

    5 dbms_output.put_line ('in the section of code');

    6 null;

    7    --

    8 return 1;

    9    --

    10 exceptional

    11 so that others

    12. can

    13 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    14      --

    15 return 0;

    16      --

    end 17;

    18.

    The function is created.

    SQL > select double myfunc;

    MYFUNC

    ----------

    1

    1 selected line.

    In the section of code

    SQL > create or replace function myfunc

    2 return number

    3 as

    n number 4;

    5. start

    6 dbms_output.put_line ('in the section of code');

    7 n: = 1/0; -force an error (zero divisor) to join the exception handler

    8    --

    9 return 1;

    10-

    exception 11

    12 so that others

    13. can

    14 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    15      --

    16 return 0;

    17      --

    18 end;

    19.

    The function is created.

    SQL > select double myfunc;

    MYFUNC

    ----------

    0

    1 selected line.

    In the section of code

    In the handler for exception ORA-01476: divisor is equal to zero

    SQL >

  • sys_refcursor do not fetch any data, even if the query returns the value

    I use sys_refcursor to return the columns and aid below the procedure to do. Although the data are there in table_1 and table_2.

    PROCEDURE test_pro (abc_date N, DATE,
    cur_get_data ON sys_refcursor
    )

    OPEN cur_get_data
    for
    Select A.col1, B.col2
    from table_1 A
    where A.dis_date = abc_date
    left outer join
    table_2 B
    on
    A.dis_date = B.dis_date;

    IF cur_get_data % rowcount = 0
    then
    raise e_error;
    END if;

    EXCEPTION
    When e_error
    then
    -no_data_found;
    while others
    then
    -(giving an error with the SQL error code);

    END test_pro;


    When running under sql in the sql pl/sql developer window pick
    data
    Select A.col1, B.col2
    from table_1 A
    where A.dis_date = abc_date
    left outer join
    table_2 B
    on
    A.dis_date = B.dis_date;

    But while testing the test_pro in the test of the pl/sql Developer window, it is
    do not fetch all data and raise e_error every time

    is there a problem arising from the use IF cur_get_data % rowcount = 0 whenever that happens in the exception block.

    so can someone please put a few ideas what cud be the reason for this?
    PROCEDURE test_pro(abc_date IN DATE,
                       cur_get_data OUT sys_refcursor
                      ) is
    BEGIN
    
      OPEN cur_get_data for select A.col1,B.col2
                              from table_1 A
                             where A.dis_date = abc_date
                                   left outer join
                                   table_2 B
                                on A.dis_date = B.dis_date;
    
    /* while testing let exceptions just pop out
    EXCEPTION
    
      when no_data_found
      then
    ------no_data_found;
      when others
      then
    --------(giving SQL error with error code);
    */
    END test_pro;
    

    then you test as something like

    declare
    
      my_date   date := to_date('20120621','yyyymmdd');
      my_cursor sys_refcursor;
      col1      ... ;
      col2      ... ;
    
    begin
    
      test_pro(my_date,my_cursor);
    
      loop
    
        fetch my_cursor into col1,col2;
        exit when my_cursor%notfound;
        dbms_output.put_line(col1 || ' ~ ' || col2);
    
      end loop;
    
    end;
    

    Concerning

    Etbin

  • Mathmatical function to return the value in injectors

    Hello
    I have obliged. If value for ex Lake 4400000, he should return as 4.4millions even for billions.
    is there an oracle function to return the value in this format. ???

    Hello

    When I want to have a "readable" released in large numbers, I use to do the following:

    Scott@my11g SQL>with t as (
      2  select 3456123456 n from dual
      3  union all select 4567123 from dual
      4  union all select 123465 from dual
      5  )
      6  select n, case when n>1000000000 then trunc(n/1000000000,1)||' Billions'
      7  when n>1000000 then trunc(n/1000000,1)||' Millions'
      8  else to_char(n) end fmtn
      9  from t ;
    
             N FMTN
    ---------- -------------------------------------------------
    3456123456 3.4 Billions
       4567123 4.5 Millions
        123465 123465
    

    ------
    * + [change] + *.
    Moreover, lakh [url http://en.wikipedia.org/wiki/Lakh] has no meaning outside of South Asia.
    Especially for a French man like me, grown with [url http://en.wikipedia.org/wiki/International_System_of_Units] International system of units that is fighting against what I call "funky" measures empirical such miles, yards, feet, inches, just not multiple of 10³
    Same billion mean differ depending on the country (see [url http://en.wikipedia.org/wiki/Long_and_short_scales] long and short scales)

    Just for "fun": [url http://articles.cnn.com/1999-09-30/tech/9909_30_mars.metric.02_1_climate-orbiter-spacecraft-team-metric-system?_s=PM:TECH] this is what can happen when we do not use the same system of units.

  • ORA-06503: PL/SQL: function returned no value

    Hi guys,.
    I wrote a function that returns the number of quarter for a given date.
    Here's the function

    FUNCTION to CREATE or REPLACE fn_get_quarter
    (p_date DATE)
    RETURN NUMBER
    AS
    v_qtr NUMBER;
    BEGIN
    Select TO_CHAR (p_date, 'Q')
    IN v_qtr
    DOUBLE;
    dbms_output.put_line (' it's quarter ' | v_qtr);
    END;

    It compiled without error.

    Here is the test case that I wrote

    DECLARE
    p_date DATE: = TO_DATE('12/22/2009','MM/DD/YYYY');
    v_qtr NUMBER;
    BEGIN
    v_qtr: = fn_get_quarter (p_date);
    END;

    When I run the present, I get the following error.

    ORA-06503: PL/SQL: function returned no value
    ORA-06512: at "GPS_FVO. FN_GET_QUARTER', line 13
    ORA-06512: at line 7

    But surprisingly, I get the result.

    Please suggest and let me know how to get rid of this error and why I get this error.

    Thanks in advance.
    Sam

    RETURN v_qtr;
    should be added after DBMS_OUTPUT

Maybe you are looking for