Pass parameters to the box of the HTML form to a stored procedure

I'm always looking for a solution to my problem of forms. For the record, I don't use Express applications to create my application - I use PL/SQL right. I need to know how to pass parameters from the box to my Web form. I welcome people select one or more checkboxes in a form that calls a remove function to delete the selected records. What I read in Oracle of the "Guide to the developer of database applications - Fundamentals" is not useful to me. If someone could tell me some examples, maybe I could see what I'm doing wrong. Here is what I wrote in "the developer of database applications - fundamentals Guide ':

All the boxes with the same NAME attribute are a group of checkbox. If none of the boxes in a group is selected, the stored procedure receives a null value for the corresponding parameter.

If a check box in a group is selected, the stored procedure receives a single parameter of VARCHAR2.

If more than one check box in a group is enabled, the stored procedure receives a parameter with the type of PL/SQL TABLE OF VARCHAR2. You must declare a type like this, or use a pre-defined as OWA_UTIL. IDENT_ARR. To retrieve the values, use a loop:
CREATE OR REPLACE PROCEDURE handle_checkboxes ( checkboxes owa_util.ident_arr )
AS
BEGIN
...
FOR i IN 1..checkboxes.count
LOOP
htp.print('<p>Checkbox value: ' || checkboxes(i));
END LOOP;
...
END;
/
SHOW ERRORS;

I'm not sure that understand what your question is.

If your web form has the following defined all with the same name:

one
two
three

You create and save a procedure to manage the sending of a form that contains a parameter with the name of attrib type owa_util.ident_arr for example:

create or replace procedure handle_form(attrib owa_util.ident_arr) as
  iter number;
begin
  for iter in attrib.first .. attrib.last loop
    -- do something with attrib(iter)
  end loop;
end;
/

Now, the only problem with this Manager (or any other), is that if the user selects any of the boxes, or no value for the parameters expected, the Manager called with parameters missing or with on all of the passed parameters, as well as the call will error.

To move, you need to provide default values for all parameters passed to your handler such as the settings of ident_arr, but with ident_arr settings, it's hard to do with autonomous procedures. If you place your procedure in a package you can define variables of package-level of the appropriate types that can be used as default values:

create or replace package my_web as
  empty_arr owa_util.ident_arr;

  procedure handle_form(attrib owa_util.ident_arr := empty_arr);
end my_web;
/
create or replace package body my_web as
  procedure handle_form(attrib owa_util.ident_arr := empty_arr) as
    iter number;
  begin
    for iter in attrib.first .. attrib.last loop
      -- do something with attrib(iter)
    end loop;
  end;
end my_web;
/

now, when you hit in the situation where the user does not select the checkboxes, the call to handle_form will be no reviewable error on due to missing parameters, and the empty_arr will not have all the elements to iterate over so the loop in the body of the procedure will be fine and you will be able to retrieve each value of the checkbox selected attrib table when you iterate on it.

Tags: Database

Similar Questions

  • JDeveloper 10 g & ADF Faces: how to pass parameters to the html page request?

    I have a simple HTML as follows:
    ...
    < name of the form = "form1".
    action = "http://myserver/MyApp/faces/start.jsp".
    method = "POST" >
    < label for 'USER' = > USER < / label >
    < input type = "text" id = "USER" > < / input >
    < input type = "submit" value = "Send" > < / input >
    < / form > < / body >
    ...
    In my ADF Faces application, I traced a javax.servlet.Filter custom class with the following text for the doFilter method:

    ' Public Sub doFilter (ServletRequest request, ServletResponse response,)
    FilterChain chain) throws IOException,.
    ServletException {}

    System.out.println ("filter in MyApp");
    Map map = request.getParameterMap ();
    User String = (String) map.get('zoom') ("USER");
    System.out.println ("map of ask size:" + map.size () + "user:" + user);

    ...
    }

    What is printed:

    02/11/16 14:27:26 filter in MyApp

    02/11/16 14:27:26 length of content: 0 coding: iso-8859-1 getContentType: application/x-www-formulaires-urlencoded

    02/11/16 14:27:26 size request card: 0 user CRDBApps: null


    What can be the problem?

    Thank you!

    Hi Wes Fang

    Maybe you can try to use "name" instead of "id" for the input tag?

    
    

    success
    Jan Vervecken

  • need help to pass parameters to the Flash

    Hello

    I'm pretty new to Flash and tried to solve this problem in the past few hours.

    What I want to do is to pass parameters from the browser to Flash.  I googled and it seems that the best way is FlashVars.

    However, I tried different codes and can not get Flash to detect settings.

    I decided to follow the example here and just copy and paste everything (just change the "main.swf" in my swf name):

    http://www.Kirupa.com/Forum/showthread.php?t=334923

    Flash loads, but it shows that ' param: "without anything else.

    I gathered that it is probably a foundamental problem more.  (for example how I am debugging, or some settings, etc..)  Clues?

    (I use CS4 trial AS3 version).

    Thank you!

    If you use the standard flash integration, you must list your flashvars in 3 locations in your html file.  you do this?

  • How to run and pass parameters to the exe file in the txt file.

    Hello

    I am facing problem with passing parameters in the .exe file, which is run by labview.firstly that I have script .txt with the settings that I have to go to the .exe file. This .exe file is also a software, and this script is written for her. And now I have to create program in labview which should satisfy the following points.

    1. I have to use a button named "Run script". If I pressed the button, it should open the browser where I can choose the script .txt file.

    2 .exe application is expected open(Path already chossen).

    3. After passing the .exe application settings should be closed.

    4 and labview should now update its parameter

    I just open using Exce.vi .exe file, but I didn't get any idea to do more than this.can someone please help me?

    Thanks norbert. CAN I love it? What should I change now? VI attached below...

  • Passing parameters to the URL - availability in the new process of request

    Hello

    I am able to pass parameters in the URL of the APEX that defined the points of the application as below

    : http://application-tier server: port/pls/apexdev/f? p = 1001:1:APP_CLIENT_NUMBER, APPLICATION_NUMBER:0001285, 0000051:

    I would like to get and set other items based on elements of application passed as parameters. I would like to only enter once application.

    I found the best place for this action in a process of application with Point on new Instance of Process.

    The problem seems to be that the value of point of application has not been set at this point, and therefore the values are null.

    If I change the application process process Point to something that runs to each page as On Load: after the header, then the values are available. It is not suitable as only wish to run once at startup of the application.

    I can't find discussion of this documentation.

    1. I would be able to access URL parameters in the application process with Point on a new Instance of the process?

    2. are there any other equivalent task for access to URL parameters at the start of the application?

    Thank you

    Hello

    APEX runs only on the new process Instance when a new session has been set up. As you discovered, URL items are not yet saved in session at this point State. You can use a level app process before header instead, with a condition that makes that make it run when certain elements that you want to initialize are null.

    Kind regards

    Christian

  • Passing parameters to the named method built-ins

    Hello

    Can I pass parameters with the "named" built-ins in forms 6i or another method?

    I tried this

    OPEN_FORM (FORM_NAME = > ' C:\Users\Roma\Desktop\NATIONAL TECH.) FMX');

    but failed ' wrong number or types of arguments error.»

    The name of the parameter is FORMMODULE_NAME in this version of the signature of OPEN_FORM.

    (Do not know why the parameter has different names in different versions of signature)

    Try

    OPEN_FORM (FORMMODULE_NAME => ' C:\Users\Roma\Desktop\NATIONAL TECH.) FMX');

  • Passing parameters to the query to extract in a stored procedure

    How pass us in a parameter of a query retrieves in a stored procedure?

    Because for example I: -.

    FOR SheikYerbouti in company

    LOOP

    SELECT extract (response,'/ list/hwid [@name = "Tom"] / descendant::node () / address) employee where id = 9506;

    END OF LOOP

    Instead of TOM, I want to pass a variable because I use the stored procedure. The variable is emp_rec.name

    SELECT extract (response,'/ list/hwid [@name = emp_rec.name]/descendant::node()/address) employee where id = 9506; does not work?

    The XPath expression is of type string, concatenate the value:

    extract (answer, "/ List/hwid[@name="' |) emp_rec. Name | ([""] descendant::node () ')

    However, depending on your version of the database, there may be better alternatives, so if you can give us a little more explanation on your requirement, we would be able to offer other options.

  • ID attribute in the attribute of the html form element of: p1_item

    Hello
    How can I place id = 'demo' in the attribute of the html form element of: p1_item. It does not. There error Throughing attributes, •size and ID do not have to be specified. (Go to the error)




    Thanks and greetings
    CORINE

    I just tried the thing above with dynamic Action and its works for me

    If possible for you, please try dynamic action "during the click on the button" with "execute Javascript Code.

    and write it in the code

     $(".demo").css("background-color","yellow"); 
    

    and it will work.

    Kind regards
    Tauceef

  • several events in the attributes of the Html form element?

    How can we put more than one event in the Form Html element attributes?
    For example, I have:

    onChange = "zeroTenScaleCheck (this); »
    and
    onClick = "checkScroll (this); »

    I want both of you to be active on the same element. It is possible and if so, how?

    Another related question is, is it possible to have two handlers listening on the same
    event?

    Thank you!

    Hello

    Place the HTML Form attributes of the element element

    onchange="zeroTenScaleCheck(this);" onclick="checkScroll(this);"
    

    Call two javascripts for example the onchange event, place to the Form HTML element attributes

    onchange="zeroTenScaleCheck(this);checkScroll(this);"
    

    Kind regards
    Jari

  • Disable the Textfield object when you change the HTML form element

    How to disable a texfield if you change the HTML form element? It must be activated at the creation of the new entry form / record.

    Yogesh

    Select 'Read only type of condition' as a value of the element in Expression1 is NOT NULL and in Expression1 put your key primary name of the option to for example P1_EMP_ID

    Kind regards
    Hari

  • How can I call two functions in the HTML Form element attributes

    Hello

    I want the same value in the text field two, when I select the value to select the list then the value with a number increment should be two text field.
    I use both java script

    < script >
    function sumItems() {}
    function getVal (item) {}
    If ($x (point) .value! = "")
    Return parseFloat ($x (item) .value);
    on the other
    return 0;
    }
    $x('P19_LAST_END_YR').value = getVal ('P19_LAST_STR_YR') + 1;
    }
    < /script >


    < script >
    function per1Items() {}
    function getVal (item) {}
    If ($x (point) .value! = "")
    Return parseFloat ($x (item) .value);
    on the other
    return 0;
    }
    $x('P19_LAST_END_YR').value = getVal ('P19_START_YEAR') + 1;
    }
    < /script >


    now how can I call function onchange two attributes of the element in the HTML form for the discount:
    ' onChange = "javascript:sumItems()" onChange ="javascript:per1Items().

    Hello

    Try

    onchange="sumItems();per1Items();"
    

    BR, Jari

  • the html form element attributes

    Hey guys,.

    Have a question about the attributes of the html form element
    For a P1_Code element, I have an onchange = attribute "f_TestOnDemand (this.value)" "
    Now if I want to add another attribute to the same P1_Code element, how to combine the two

    the two attributes that I want to include for the same item are:

    OnChange = hilitebtn (this.value)
    OnChange = "f_TestOnDemand (this.value)" "

    Thank you guys
    Appreciate your help
    Jesh

    Jesh salvation,

    You must specify JavaScript functions in a defined mode of semcolon. In your example it will be as follows.

    onChange = "hilitebtn (this.value); f_TestOnDemand (this.value)" "

    Thank you best regards &,.
    Vikas

    You can reward this answer by marking as being useful or correct ;-)

  • The HTML Form element attributes: Onchange

    Hello
    I get an error when I have two "Onchange =" for an Items element. Its shape and I want to be able to click the Previous and Next button to scroll through the records, but one already has an Onchange when the other Onchange is added I get an error:
    The form Creation Wizard of paging uses
    the JavaScript onChange event to alert users
    When they are about to leave a page without
    save their changes. Remove the onChange
    event from any article with a database source
    Column, restart the wizard.
    Is it possible to have two Onchange =... to an article 'Attributes of the HTML Form element'?

    You are welcome!

    Concerning

    Andy

  • to find the location of PL/SQL, stored PROCEDURE in the database

    Hello

    This is the detail I have the executable of the Application Developer program simultaneous

    Executable NAPESCO_STAFF_LEDGER_DTLS

    Short name NPSTALEDDTLS

    Application of human resources

    Execution of PL/SQL, stored procedure method

    Name of file execution NAPESCO_STAFF_LEDGER_DTLS


    I would like to know how to view and change this procedure, where it is stored

    kindly help

    Hello

    This seems to be a custom package. To display the source of the simultaneous program ' PL/SQL Stored Procedure', please refer to (Note: 455582.1 - where can I get the whole "stored procedure" Pl/Sql Source file on the current program?).

    Thank you
    Hussein

  • Faced with HTML5 - only may not even pass parameters to the script .jsx

    I am really struggling to get acquainted with HTML5 and the conversion of my existing extension.  A general request first - what are the best resources to help a general grounding in HTML5?

    Now a specific question.  In the default example functions in the .jsx are all processed in $._ext_.  What is the purpose of this?  How do you pass a parameter in a function that is defined like this.  Now, I'm trying just to pop up an alert with a parameter passed.  I tried many things, but here I am:

    In my index.html file, I have a button:

    < li > < button class = "default" id = "btn_LoadPresets3" onClick = "wizClickButton('10')" > myFunction < / button > < /li >

    In the ext.js script, I have a function which gets this:

    function wizClickButton (inParam) {}

    Alert ("press me" + inParam);

    var csInterface = new CSInterface();

    csInterface.evalScript ('myFunction2()');

    }

    In my script .jsx, I have the following function:

    function myFunction2()

    {

    Alert ("Yo");

    };

    Now - when I run this and press the button, the first alert box shows and shows me my parameter ("press me 10" in this case).  But that's all - so the function in my script .jsx never gets called.  I don't know why.  So - I look at the example functions and they are all preceded with the $._ext - I change the function in my script .jsx for:

    $._ext_myFunction2 =

    {run: function() {}}

    Alert ("Yo");

    }

    };

    and modify the ext.js call to call the same

    function wizClickButton (inParam) {}

    Alert ("press me" + inParam);

    var csInterface = new CSInterface();

    csInterface.evalScript (' $. _ext_myFunction2.run () ');

    }

    So now, when I run it I get the second alert box.  Everything is good.  Only how I pass my parameter down in the script .jsx?  Where the parameter is both the definition of the function and the call to the function?  That brings the ._ext_ $ to the party?  Why not my definition of the standard function without the ._ext_ $?

    Many thanks in advance,

    Richard

    Hi Richard,

    I first suggest you use reusable code David Deraedt (and not Extension Builder, which treats the $. useless _ tips): davidderaedt/CC-EXT-SDK · GitHub. I don't know why you get the error: I don't use $._ext_ me so it shouldn't be a requirement.

    You can find a few first aid signs in my HTML signs quick tips. You will also find the way to pass parameters of JS-> JSX (as simple or complex objects parameters) and vice versa, JSX-> JS

    HTML: personally I found useful tutorials on www.tutsplus.com (HTML, JS, etc) but I guess there are a lot of free resources out there (the one that comes to mind is a A Practical Guide to HTML & CSS - learn how to build Web sites, Apple made one too Safari Web content Guide: HTML Basics).

    Concerning

    Davide Barranca

    ---

    www.davidebarranca.com

    www.cs-extensions.com

Maybe you are looking for