two related issues: to call the stored procedure and passing in an array of elements using htmldb_Get

I need to save items of ApEx generated dynamically via AJAX.  I use the APEX_ITEM API to generate the elements.  At runtime, I have no idea how much of elements are generated on the page, but I know that they're all separate and discreet 'name' attributes, i.e. f01, f02, f03, etc..  As a basic example, if I have to generate a selection list, I know that the parameter "p_idx" of the APEX_ITEM call is to say '3', so select all lists that get generated have a "name" attribute in "f03" DOM, all text elements will be "f01", etc.

I want to record these data in the database using AJAX.  It is common to call the javascript htmldb_Get function that is standard for the use of an application process, but I am interested in the use of the rarely called upon 'internal' and queryString"options of this javascript function so that I can build the query string to the fly according to what is on the DOM when it tries to save the data they have entered into these items generated by APEX_ITEM.  Someone at - there are good examples of the use of the 'procedure' and 'queryString' the javascript htmldb_Get function parameters?

I have found a handful of some blogs, messages, etc. online linked to this, but just for most people regurgitate the documentation.  I found this post (https://forums.oracle.com/thread/2549237), which has had a glimpse of hope to move from a table (which is something I need) as a parameter, but as someone in their right mind would check this before you go this route.

Shane.

ApEx 4.2.1

Shane

Since you mention that you are on 4.2 APEX I advise to use apex.server.process which is replacing the htmldb_Get officially undocumented documented.

In the literature, it is that the first parameter is the ajaxidentifier but it's actually the name of the process.

The data object would be something like

var lData ={f01 : get_value_array('f01')}

Where is get_value_array

function get_value_array(pColumnName) {
  var l_values =[];
  apex.jQuery('[name="'+pColumnName+'"]').each(
   function(){
    var l_value;
    l_value = apex.item(this.id).getValue();
    l_values.push(l_value);
   }
  );
  return l_values
}

For an example see this demo.

Nicolette

Tags: Database

Similar Questions

  • Call the stored procedure, and bind parameters by name

    Hello

    I use the Oracle ODBC 12 c driver to pass values from one Interface to our database Oracle 11.2. The Interface software collects data from modbus protocoll and calls a stored procedure. Right now my syntax to call the stored procedure looks like this:

    CALL procedure-name ('STRING', 'Timestamp as String', numValue1);

    It works very well. Now, I have to add a default setting to my procedure. To stay flexible to make other changes, I want to call the procedure and bind the parameters by name. Release 10.2.0.1.0 ISC ODBC Notes:

    Added support for the named parameter, binding the parameters by name. ODBC Oracle driver now allows the application to specify the parameters of a stored procedure by name, in the procedure call. Named parameters are to be used in calls to stored procedures and should not be used in other SQL statements.

    So, it shouldn't be a problem to use named notation, but how do I do this in ODBC? I tried like this, but oracle returns an ora-00936 error of missing expression:

    call procedure-name (paramName1 = > 'STRING',= paramName2 > 'Timestamp as String',paramName3 = > numValue1).


    Thank you for your help.

    Finally, I was able to find the error. The syntax of the statement was very good. The problem was caused by another declaration that I edited before and the error has not attracted Attention immediately.

    Thanks for reading and looking for an answer.

  • call the stored procedure in a column in the report

    Hi all
    I'm new to APEX. I did a search on this forum, but could not get an exact answer.
    I know how to call or execute a procedure from a button. as to create a PL/SQL anonymous bloack and partner is key.

    My question is a little different. I have a report with 11 columns. the last column shows just "delete" for all lines (I did it in my request to report as SELECT x, y, z,..., 'remove' AS delete). When I click on this cell for any line (this column can be a hyperlink or any clickable element), I would like to call a stored procedure that takes parameters as values in columns 2 and 4 for this particular line.

    for example, my report looks like somethnig like below,

    FILE_ID MEMBER_CD ACTION
    112 ABCD Remove
    WXYYZ 113 remove
    114 PQRS remove

    I want to click on the 'delete' in the first line which should call a stored procedure and pass of 112 and ABCD as parameters to the procedure.

    I now have the procedure as a process. sturggling to link this column to procedure but without success :(

    Hope realized. Please, any help is appreciated.

    Thank you

    Hello

    I work in the drudgery of google and firefox if ever the reliased, the thanks of the error to report

    exact code in URL should e

    javascript:document.getElementById('P1_RECORDID').value = '#recordid#';doSubmit('DELETE_RECORD');
    
  • How to call the stored procedure from javascript? (Google suggest, AJAX)

    Hi I want to set up a text field so that it behaves like [Google Suggest | http://www.google.com/webhp?complete=1 & hl = en].

    I read this post .

    Now, I installed everything according to this document. But it simply doesn't. And I don't know why.

    I think that problems can fall into the following three categories:
    1. the text field and the page invoking the appropriate javascript?
    2 - is the JavaScript call the stored procedure?
    3. the stored procedure correctly returns the result formatted?

    I'm assertive for 1 and 3, but I'm not sure 2. Because I don't know how if a stored procedure has been called? Is there a PL/SQL statement that I can query in SQL * more?

    Also, I would like to know how to debug AJAX in the APEX. It involves a lot of things.

    Finally, I used APEX 3.2 and Oracle XE. I can't find file dads.conf or marvel.conf. Is ' / apex / "the virtual directory for APEX?

    Thank you very much!

    Buffalo,

    I managed to make it work on XE with APEX 3.2!
    It took more time than expected because my XE installation was still on an earlier version of the Apex and I had put it first...

    But that's what I did:
    -in the ac.js file, I changed the path ' / apex / "and I added the ac.js file to my candidacy as a static file. So as you did.
    -J' copied my request to the XE and copied my procedure on the schema that is related to my request
    -J' gave to run anonymous rights my procedure

    Now at first, it did not work...
    Then I suddenly remembered something: If you want to run a procedure through the pl/sql gateway in the XE, XE please how it is.
    Do you this by changing the APEX_030200.wwv_flow_epg_include_mod_local function!

    This is the code for the function changed for my example:

    CREATE OR REPLACE function APEX_030200.wwv_flow_epg_include_mod_local(
        procedure_name in varchar2)
    return boolean
    is
    begin
        --return false; -- remove this statement when you modify this function
        --
        -- Administrator note: the procedure_name input parameter may be in the format:
        --
        --    procedure
        --    schema.procedure
        --    package.procedure
        --    schema.package.procedure
        --
        -- If the expected input parameter is a procedure name only, the IN list code shown below
        -- can be modified to itemize the expected procedure names. Otherwise you must parse the
        -- procedure_name parameter and replace the simple code below with code that will evaluate
        -- all of the cases listed above.
        --
        if upper(procedure_name) in (
              'MATTHIASH.INCSEARCH') then
            return TRUE;
        else
            return FALSE;
        end if;
    end wwv_flow_epg_include_mod_local;
    /
    

    After that, the AJAX function worked as expected...

    HTH
    Matthias Hoys

    Published by: mhoys on August 13, 2009 15:24

  • Call the stored procedure to support bean w / table setting dimensional bi

    Hi all, I use jdeveloper 11g

    I have a requirement where instead of calling several times a "insert into" statement rather call a stored procedure, a table shipping two-dimensional bi as a parameter.

    The table must have size [n] [4] and [0] [0] = string and others must have numbers.

    This is because users will be inserting thousands of records at a time, remote sites, so the load of sending of a should be avoided.

    Any suggestions?

    Thank you.

    Miguel,
    If you use ADFbc (VO and EO sense), you can use batch insert for this archive.
    However, he must think about the user interface and how to transfer data from the client to the server taking the place of the insert.

    How you accumulate the data to insert into the DB?
    Are able to collect you say 1000 records a time and transfer them in a single segment on the server?
    How about data validation and exception handling while inserting into the db?

    I'm sure you can use a pl/sql procedure to do the Insert, but the questions above should always be answered.

    Timo

  • Creation of Adaptert DB to call the stored procedure in MS SQL server

    Hello

    I need to create a DB adapter to call a stored procedure in MS SQL Server.

    I went through the MS SQL Server database connecting wire

    He mentions that he must use a command line utility to generate the wsdl and xsd to call stored procedures in MS SQL server. Please indicate where this utility and how to use it.

    All links to tutorials are welcome.

    Thank you!!.

    Silas.

    The key is SOA_HOME\j2ee\home\connectors\DbAdapter\DBAdapter.jar.

    Make sure that the DBAdapter.jar is at this place

    in my case, it is

    e:\Oracle\product\soa\10.1.3\j2ee\home\connectors\DbAdapter\DBAdapter.jar

    see you soon
    James

  • call the stored procedure to a pop up window problem

    Hello

    I use jdev 10g. with ADF BC.

    I have a page jspx with a command button passing 2 parameters to a window popup using processScope. This window contains an entry form containing the parameters passed and 1 other inputText field. The user will enter a value for the inputText field and click the OK button. When you click this button, I need to pass the value entered by the user as well as the parms passed 2 to the AM that calls my stored procedure. The inputText field is defined as < af:inputText value = "#{bindings.workCode.inputValue}" which works very well but the parms passed show as null in the AM. "

    How can I get these 2 parameters to pass to the AM?

    Thank you!

    The following code prints null as well?

    public void Oracle_Proc (String seqNo, String yrCode, String subdivided) {}

    * System.out.println ("seqNum:" + getELValue("#{processScope.seqNum}")); *
    * System.out.println ("yearCode:" + getELValue("#{processScope.yearCode}")); *

    CallableStatement cs = this.getDBTransaction () .createCallableStatement ("{call user. Oracle_Proc(:1,:2,:3)} ", 1);
    try {}

    cs.setString (1, seqNo);
    cs.setString (2, yrCode);
    cs.setString (3, subdivided).
    DSI Execute();

    } catch (SQLException e) {}
    TODO
    e.printStackTrace ();
    }
    }

    * public String getELValue (String expr) {*}
    * FacesContext fc = FacesContext.getCurrentInstance (); *
    * ValueBinding vb = fc.getApplication () .createValueBinding (expr); *
    * return (String) vb.getValue (CF); *

    *}*

  • call the stored procedure in oracle toplink

    Hello
    I use jdev 10.1.3 toplink.
    call oracle stored procedure always failed ora-00900 invalid sql statement.

    Workaround I found is using below codes:
    String sql = "{RESETCURQTY (?). call} ";
    UOW UnitOfWork is getSessionFactory () .acquireUnitOfWork ();.
    uow.beginEarlyTransaction ();
    Conexion Connection = ((UnitOfWorkImpl) uow) .getAccessor () .getConnection ();
    CallableStatement call = null;
    try {}
    Call = conexion.prepareCall (sql);
    call.setString ("P_BRANCHCODE", branchCode);
    Call.Execute ();
    } catch (SQLException ex) {}
    ex.printStackTrace ();
    } {Finally
    {if(Call!=null)}
    try {}
    Call.Close ();
    }
    catch (SQLException e) {}
    e.printStackTrace ();
    }
    }
    }

    I found a few doc toplink on the use of StoredProcedureCall, none of it to success.
    / * A session = getSessionFactory () .acquireSession ();
    Call of StoredProcedureCall = new StoredProcedureCall();
    call.setProcedureName ("RESETCURQTY");
    call.addNamedArgumentValue ("P_BRANCHCODE", "TEST");
    Query ValueReadQuery = new ValueReadQuery();
    query.setCall (call);
    query.addArgument ("P_BRANCHCODE");

    Vector of parameters = new Vector();
    parameters.addElement (branchCode);
    session.executeQuery (query);

    TopLink support calls a stored procedure?

    Thank you
    Ricky

    Hello

    Looks like the database is to launch an exception because you run the query as a read request instead of as a non-selection call. Try to use a DataModifyQuery instead, or you can run the StoredProcedureCall directly using session.executeNonSelectingCall (call);

    Best regards
    Chris

  • Call the stored procedure to odi

    Hi all

    Posible calls a pl/sql stored procedure of odi?

    In ODI, create a procedure in your project, here, you can call a stored procedure name.

    This can then be slid into a package as a package step.

    geeo

  • Call to the stored procedure parameter passing script

    Hello

    I have a database on linux server. On the same server, there is a shell script which takes 3 parameters.

    Now I want to do a procedure (stored procedure) that will have 3 parameters pass and run this script with these settings.

    I had created object directory pointing to the correct directory granted all privileges on it (I hope).

    Now, I wondered how the code of procedure?

    I also did a program within the database which takes 3 parameters, but I don't know how to operate it. I don't know if I can use work to run the program, because

    It is a multi user thing and I think that this will not work as expected if 2 or more users run it.

    In any case, I was hoping that I can solve this problem by creating the procedure that will run the script that is provided with 3 parameters, that I need.

    I hope I'm clear on what I want to do.

    Please if you have an idea how to Edifier post your ideas.

    Thank you!

    Hello

    first I want to thank you for the reply.

    option 1... I don't want not to use java or c because I have no skills in programming languages.

    option 2 you mentioned dbms_scheduler.

    If I understand the procedure should go like that.

    I create whitin database program. Then I create a job which runs this program. And whenever I want to run my shell script, I'll do the work.

    WHA happen if 2 different users will want to run the script at the same time?

    Thank you for your response.

  • How to call the stored procedure when I press the button

    Hello

    I want to know how to call the procedure/SQL statement when I press the button using callable statement.

    can someone give me it please link who knows the steps to do this.

    Thanks in advance,
    SAN

    Hello

    read this good example http://www.baigzeeshan.com/2010/05/calling-plsql-procedure-and-function-in.html

    ~ Abhijit

  • How to get the return value of the method by calling the stored procedure in ApplModuleImpl

    Hello

    I use Jdev 10.1.3.4
    JSF, and ADF business components
    I created a service method in the implementing class of module request to execute the strored procedure in the database.
    This breeding returns a string value.
    now, I slipped the method of service of data control palette on my JSF page and chose ADF parameter form when I droped.
    It works very well.
    now, I want to display the string returned by the method of service after the execution on the JSF page as global messages.
    How can I achieve this.
    Help, please

    Thanks in advance

    Kind regards
    Ajit Agarwal

    Hello

    You must run programmatically run the method binding. If I'm not wrong then the following code will allow you to access the return value

    OperationBinding oper = bindings.get("MyPLSQLAccessMethodBinding") (OperationBinding);
    String returnValue = oper.execute ((String));

    Once you have the string in a managed bean you can add it to the stack of messages JSF exposed by the FacesContext

    Frank

  • Insert a record, call a stored procedure and execute a shell script

    Hello

    I am trying to build a page APEX do these three things in order.

    #1. Insert a new record in a database table (pk, donnees_xml, attr1 and attr2, etc.) and download the XML file to the donnees_xml column

    #2. Save this XML file on a file system

    #3. Parse the XML file on a file system and update the database with the parsed data table

    I can do #1 with a regular shape based on the database table. I can do #2 with a stored procedure.

    I can do #3 with a shell script.

    I wonder how these tasks can be combined into a single action in APEX.

    do #1;

    If successful, do #2;

    If successful, do #3;

    I'd appreciate comments on this.

    Thank you

    Define a process of PL/SQL page submit that runs after the record is inserted, if P1_FILE is not null.

  • Need help by calling the stored procedure

    Hi Experts,

    I created under procedure, while calling me, it throws an error.
    CREATE OR REPLACE PROCEDURE spdemo (param1 OUT NUMBER)
     is
     BEGIN
     SELECT COUNT(*) INTO param1
     FROM TEST_DEMO;
     END;
    Can any1 help me get the result or to call this procedure?

    Thnx in advance...

    Published by: 977490 on January 18, 2013 02:25

    Hello

    977490 wrote:
    ... I created under procedure, while calling me, it throws an error.

    If the problem of the call, and then after the call.

    Here's a possible way to call spdemo and see the results:

    SET   SERVEROUTPUT   ON
    
    DECLARE
        test_demo_cnt  NUMBER;
    BEGIN
        spdemo (test_demo_cnt);
    
        dbms_output.put_line (test_demo_cnt || ' = value returned by spdemo');
    END;
    /
    
    CREATE OR REPLACE PROCEDURE spdemo (param1 OUT NUMBER)
    is
    BEGIN
    SELECT COUNT(*) INTO param1
    FROM TEST_DEMO;
    END;
    

    I'm tempted to make a function, not a procedure.

    CREATE OR REPLACE FUNCTION spdemo
    RETURN NUMBER
     IS
        cnt          NUMBER;
     BEGIN
         SELECT  COUNT (*)
         INTO    cnt
         FROM    test_demo;
    
         RETURN  cnt;
     END;
    /
    SHOW ERRORS
    

    Then you can call it in the SQL statements, as you call functions such as SYSDATE:

    SELECT     spdemo
    FROM     dual
    ;
    
  • Internal error: catalog view incompatible when calling a stored procedure

    Hello

    I use JDeveloper 11.1.1.4

    When you call a stored procedure from AppModuleImpl, I get this error internal error: inconsistent display catalog

    I'll call the stored procedure of this way

    String lErrCode;

    String lErrMsg;

    Result of an integer;

    ARRAY inputArray = null;

    Table STRUCT that can be passed to a PLSQL PROCEDURE

    inputArray =

    JdbcSqlMapper.preparePlSqlArrayUsingVOAttrbs (conn, recordType,

    view, rm);

    OracleCallableStatement st =

    (OracleCallableStatement) conn.prepareCall ("{?}") = call ("+

    procedureName +.

    "(?,?,?))}");

    st.registerOutParameter (1, Types.INTEGER);

    st.setObject (2, inputArray, OracleTypes.ARRAY);

    st.registerOutParameter (2, OracleTypes.ARRAY,

    recordType.getTableType ());

    st.registerOutParameter (3, Types.VARCHAR);

    st.registerOutParameter (4, Types.VARCHAR);

    St.Execute ();

    I checked the subsidies for this package to all users. All users with grants to this package.

    I don't know where I start to debug this issue.

    Kindly help.

    Thank you and best regards,

    John.

    Have yo uchecked the right of the types of data used (at least the TABLE) to the user (referred to Pokusak blog: JPublisher - incompatible catalog display)?

    Timo

Maybe you are looking for