ADF view object and stored procedure

Hi all

I am facing a problem with the view object, the case is, I created a stored procedure with an input and an output parameter

view object I need to call this procedure inside the request object view and define the attribute transient output parameter

could you please help me in this case, please give an example

Thanks in advance

Mohamed,

Can you explain your use case to help you.

Is it possible to convert the stored procedure in function (and change the output parameter to return the parameters) and create a display object using the function.

Ex: Create a display object "read access only via the SQL query" for the query: SELECT HR. PLSQLTEST2 staff (first_name) OF

K

Tags: Java

Similar Questions

  • Panel of the ADF does not variable defined in the ADF view object.

    I created a group of ADF, which allows the user to run some simple queries against a database of Oracle is using the view objects ADF and ADF view links and ADF application module.
    One of them asks detailed information of research on a database object (Table, view, or other) to dba_objects. SQL uses a parameter (: P_OBJ_NAME) which has a default value of "departments". If I run the ADF application by herself outside the ADF panel module, everything works fine, he invites me to provide a value for the parameter: P_OBJ_NAME.
    As I said the Panel contains various links to view ADF which one who must prompt the user to provide a value for: P_OBJ_NAME. When I run the Panel he does not invite me to: P_OBJ_NAME, it only uses the defined default value "departments".
    I hope that I have described my problem for everyone to understand. Of course, the question is how to make the Group ADF to prompt the user to provide a value for the parameter: P_OBJ_NAME, my waiting has been the sql of the view object and request module, both are designed to enter a value for this parameter, then the Panel should do just that, but it's not.

    Expert you would be most appreciated.
    Thank you.
    Bobby has.

    Published by: Babak Akbari, August 13, 2009 08:34

    Published by: Babak Akbari, August 13, 2009 11:12

    The instigation of a parameter is a feature that we have built in the ADF Tester - is not a default behavior that you get in your application when you have just placed a VO on your page.
    To get something like that spend the operations under the VO node in the data control palette and drag the operation "Run with parameters" to your page to drop it as a form of parameter.
    This will give your user name a place to complete the setting, then press a button to run the query.

  • Privileges differ between SQL * more and stored procedure

    A user with the dba role can access dba_role_privs. But this is not possible in a stored procedure created by the same user.
    Normally, the example should work fine
    But with Oracle XE 11.02 - cost free database with some limitations - I get error 942

    I show a simple example in SQL * more:

    SQL > r
    1 * select distinct dba_role_privs recipient where the recipient as "SY %.

    DEALER
    ------------------------------
    SYSTEM
    SYS

    SQL > create or replace procedure x as
    2 start
    3 for rec in (select distinct dba_role_privs dealer where the beneficiary as 'SY %')
    4 loop
    5 zero;
    6 end of loop;
    7 end;
    8.

    Warnung: Prozedur wurde mit Kompilierungsfehlern standing.
    English translation: procedure created with compilation errors

    SQL > show error

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    3/14 PL/SQL: statement ignored
    3/43 PL/SQL: ORA-00942: table or view does not exist
    SQL >

    How can I fix?

    Why do you think the example should work properly?

    Normally, regardless of the version, the privileges granted through roles (such as DBA) not available for stored procedures. Stored procedure of a DEFINER rights can only take advantage of the privileges granted directly to the owner of the procedure. Stored procedure of the invoker rights can enjoy privileges granted by a role, but that requires that the appellant has independent privileges to query the table in question (and, in this case, would require dynamic SQL usage).

    Generally, the simplest approach would be to grant the privilege to CHOOSE ANY DICTIONARY to the owner of the procedure.

    Justin

  • DbDataAdapter and stored procedures with Oracle cursors,

    Because of the problems I've mentioned here ([PL/SQL stored procedure causes OracleException.. .but only sometimes | https://forums.oracle.com/forums/thread.jspa?threadID=2267290]), I am trying to replace a specific layer of data ODP.NET with the code that uses the related classes, independent provider and DbProviderFactory. Things seemed to go right up to the point where I'm trying to use a DbDataAdapter object to fill a DataSet. The stored procedure, I call looks like this...

    /* - - - - - - - - - - - - - - - - - - - - */
    PROCEDURE GET_SOME_DATA)
    IN_PARAM1 IN VARCHAR2,
    O_RESULTS TO SYS_REFCURSOR);
    /* - - - - - - - - - - - - - - - - - - - - */

    Normally, I could do something like this...

    /* - - - - - - - - - - - - - - - - - - - - */
    var adapter = new OracleDataAdapter (cmd);
    adapter. Fill (ds, cmd (OracleRefCursor). Parameters [1]. (Value);
    /* - - - - - - - - - - - - - - - - - - - - */

    .. .but that is not possible when you use DbProviderFactories since there is no equivalent of the Ref Cursor. I can use a DbDataAdapter instead of an OracleDataAdapter object, but I can't understand how to fill it with the cursor. All the examples I've seen (even the specific Oracle ones) seem to assume one is writing queries like "SELECT FOO FROM BAR" or something like that.

    Am I going about this all wrong? Or is it simply not possible to use a DbDataAdapter to fill a DataSet like this? I was really hoping to be able to use the provider-independent code I could use the System.Data.OracleClient provider with my 9i database and then switch to the Oracle. DataAccess.Client once we have upgrade to 11g. Looks like I'll have to completely replace the data layer code and references. I knew that the former was necessary, but I hope this could be managed by interfaces of independent provider with concrete implementation changed via the config and/or my IoC container.

    NOTE: I found this thread in the forums, but the posters to stop before the point at which they return the sliders and make use of them: [ODP.Net Ref Cursor and DbProviderFactory | https://forums.oracle.com/forums/thread.jspa?messageID=1278007]

    Thank you!

    I did yesterday a similar thing.

    The code was specific ODP.NET (that always, it is and should be), but I didn't rely on a reference to Oracle.DataAccess directly in my particular case:

    The code I ended up with is not very pretty, but it works.

    var refCursorType = Enum.Parse (((dynamic) plant.)) CreateParameter()). OracleDbType.GetType (), "RefCursor");
    dynamic oracleParameter4 = factory. CreateParameter();
    oracleParameter4.Direction = ParameterDirection.Output;
    var piInstance = oracleParameter4.GetType (). GetProperty ("OracleDbType");
    piInstance.SetValue (oracleParameter4, refCursorType, null);

  • Question packets and stored procedures

    Been working with Oracle for a month now and I have a question about stored procedures/packages. I created 3 stored procedures and a search function to do some work as follows:
    1 load the initial set of data into a table.
    2. turn to day of the preceding table columns by using a specific search function.
    3. put to update a single column with a value based on grouped subsets of the data in the table.

    I divide the latter in separate proceedings to facilitate debugging and validation of each step, but now I want to put them all together and run them sequentially. In my view, there are two ways to do this:
    1. create another stored procedure that will run the three in the right order.
    2 create a package and move all procedures and functions and call each in the right order.

    Don't know which approach is preferable, although I'm leaning towards the first option, any actual experience would be appreciated. Thanks in advance!

    Dave

    How about option 3:

    3 create a package and move all procedures and functions, and then add an additional procedure in the package that calls each in the correct order and call this procedure.

    PS. only this last procedure must be in the package spec. All others must be put into the body (and can remain hidden for the code outside the package).

    Published by: Toon Koppelaars February 26, 2010 21:07

  • Difference between function and stored procedure

    Hi guys, I don't understand the exact difference between a function and a stored procedure. I have a lot of google but still. Can someone explain in simple terms. Thank you.

    Hello

    Here is an example of a user-defined function:

    CREATE OR REPLACE FUNCTION     factorial
    (      in_num       IN     PLS_INTEGER
    )
    RETURN     PLS_INTEGER
    DETERMINISTIC
    IS
    BEGIN
         IF  in_num IS NULL
         THEN
              RETURN     NULL;
         ELSIF in_num <= 1
         THEN
              RETURN  1;
         ELSE
              RETURN  in_num * factorial (in_num - 1);
         END IF;
    END     factorial;
    /
    SHOW ERRORS
    

    This function returns an integer. You can use the function (or, more exactly, the integer returned) everywhere where a whole expression is allowed.
    For example

    SELECT     ROWNUM
    ,     factorial (ROWNUM)     AS f
    ,     loc
    ,     SUBSTR ( loc
                , 1
                , factorial (ROWNUM)
                )          AS s
    FROM     scott.dept;
    

    Output:

    `   ROWNUM          F LOC           S
    ---------- ---------- ------------- -------------
             1          1 NEW YORK      N
             2          2 DALLAS        DA
             3          6 CHICAGO       CHICAG
             4         24 BOSTON        BOSTON
    
  • Insert multiple records in a database using the DB adapter and stored procedure

    Hi all

    I want to insert multiple records in a database using a stored procedure. I wanted to insert these records using a data adapter and data adapter must be called by a mediator.

    Can anyone suggest me some ideas if it's possible with capabtilities OOB in SOA suite or not?

    Thank you for your help in advance.

    Thank you
    Shiv

    The trick is in the stored procedure. You must use a data type that will handle multiple records I use varray. An example can be found in this post.

    Re: Mutiple calls to AppsAdapter (pl/sql) when the payload has multiple records

    When you read the procedure stored in the db adapter wizard looks and xsd / xml if you have maps accordingly.

    see you soon
    James

  • Dashboard of the guests and stored procedures

    Hello

    I have 7 guests - 2 which are necessary and others are optional. I created guests from Dashboard and grouped 2 those required in a dashboard command prompt and more optional 5 in an another guest of dashboard. All the guests are assigned to the variables and used in calling a stored procedure in SQL Server. Because I have 2 groups there are 2 go buttons on the page. I found that the order in which I enter data and click on the questions of buttons and will disrupt the call to the proc (i.e. sometimes it brings back data but sometimes she will be not based on recorded fast values).

    I have 2 questions:
    1. is it possible to separate the optional and mandatory guests so I can put them in separate the dashboard sections, but to have only 1 'Go' button to send the data?

    2. among the guests, I would like to be a multiple selection. Is it possible to send the options of multiple selections in a stored procedure? I use the variables to other values, but I've read using a variable for multiple selection is not possible.

    Any help would be appreciated
    Thank you
    UNA

    Issues related to the:
    1. not in the standard, but with a bit of javascript, it is possible
    http://sranka.WordPress.com/2008/11/09/how-to-replace-multi-go-button-prompt-by-one/
    2. it is not possible in 10 g but possible normally as promised to 11 g. You must create camps prompt or a command prompt with the different possibilities to pass a string instead of an array or a list.

    Success
    Nico

  • apex_application.g_fxx and stored procedures

    Hi all

    In a block anonymous page process type pl/sql, I try to call a stored procedure that perform a few sentences SQL (update, insert, etc.). What I want is to pass as a parameter to the table that contains the data in a query of sql update report (apex_application.g_fxx ()).

    I created a new type in the database,
    create or replace type artbl in the varray (50) of VARCHAR2 (100);

    and I tried the plsql code:

    declare
    my_arr artbl;
    whole NUM;
    Start
    my_arr: = apex_application.g_f01;
    my_storedproc (my_arr, num);
    end;

    which give the error when you try to save

    1 error has occurred

    * ORA-06550: line 6, column 28: PLS 00382: expression is of the wrong type ORA-06550: line 6, column 4: PL/SQL: statement ignored

    and


    declare
    my_arr artbl;
    whole NUM;
    Start
    my_arr: = apex_application.g_f01 ();
    my_storedproc (my_arr, num);
    end;

    which give the error when you try to save:

    1 error has occurred

    * ORA-06550: line 6, column 11: PLS-00355: table using pl/sql not allowed in this context ORA-06550: line 6, column 4: PL/SQL: statement ignored

    The stored procedure is
    create or replace PROCEDURE my_storedproc
    (IN artbl, num ENTIRE tbl)
    AS
    BEGIN
    BECAUSE me IN 1.num
    LOOP
    -carry out a few sentences making reference to elements - tbl
    END LOOP;
    END MTO_PRUEBA;


    Can someone help me?


    Thank you

    jalba

    Jalba,

    The error is the result of incompatible types. It seems that you have created your types in SQL (in the database) rather than in PL/SQL. You should simply reuse the existing type used in the APEX (see wwv_flow_global spec).

    PROCEDURE my_storedproc
    (IN artbl, num ENTIRE tbl)

    should be

    PROCEDURE my_storedproc
    (IN wwv_flow_global.vc_arr2, num ENTIRE tbl)

    Now you can call it as

    declare
    whole NUM;
    Start
    my_storedproc (apex_application.g_f01 (), num);
    end;

    I hope this helps.

    Greg

  • CFPROCPARAM and stored procedure

    Hello

    I tried to use the MSSQL stored procedure in combination with ColdFusion 9. I use the cfprocparam to transmit data to the stored proc. If I do it in the order how they are declared in the stored procedure, it works fine. But how can I transmit the data with named variables? It was the 'dbvarname' function, but I guess it's obsolete now. Do I have to use the same order in my ColdFusion component? Which makes it quite difficult to manage. I hope there is a solution for transmitting data with named variables.

    Thanks for the replies.

    Does this mean I can't use variables for stored procedures?

    [shakes his head in disbelief]

    I guess that my previous announcement didn't know somehow.

    There is no attribute of CFPROCPARAM DBVARNAME.  It has been removed from the CF after CFMX6 (I think.  "It could have been deleted after CF5).

    So: no, you can't use it.  It does not exist.

    There are docs online for this kind of thing, btw:

    http://help.Adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d 52. html

    --

    Adam

  • ADF: Re-apply the where condition of a view object and updating table

    Hello

    I have a table for documents, with columns for the title of document, document type and so on. There is also a column called "receiver".
    In the viewobject based on the table, I have a condition that only the lines where the receiver is null should be included. In other words: only documents unassigned should be indicated in the table.

    The purpose of the page that contains the table is to assign documents to the receivers. The idea is that the user enters a name in the column of a receiver or several lines and then press a button of validation.
    When a line - a document - has been assigned to a receiver and the change is committed, this line is more fills the where of the viewobject condition and I would like my page to reflect the fact that. In other words: as soon as one or more lines have been assigned to a receiver and the changes are committed, the lines should disappear from the table and the page.

    What is the best way to achieve this?

    Kind regards
    Andreas

    To do this is to add a navigation case to the same page and use this case to navigation after validation. Should run the query again, it costs you a full page sent.

    Another way to do the validation and the use of a managed method bean to re run the iterator.

    Timo

  • How to pass the variable to bind page ADF view object

    Would appreciate your help on this.
    Set up a view with a variable binding object: param1 in where clause.
    I want to pass the value of the variable to link from a page of the ADF (.jspx)

    I know that one Option using executeWithParams() method binding in the ADF page.
    But, I want to pass a pageFlowScope parameter (which is already set when loading the page) to the variable binding VO, and the VO should also display the results filtered on the page the first time itself.

    Could someone help me understand with a code, how to achieve the same. (Is there a groovy expression to access the param pageflowscope?)

    Thank you

    Published by: user5381160 on August 12, 2010 20:01

    You should also consider dragging operation executeWithParams on your workflow and of wiring to occur before your page instead of in the definition on the page itself - so it is more clear what is happening and is the approach recommended for 11 g applications. When drag-and you - drop operation, you can use the dialog box bind the parameter to your page flow - scope variable by providing the good EL there.

    There is no expression Groovy in the model layer to access the workflow variable scope page (which is in the controller layer) because this would violate the separation of concerns inherent in an MVC application.

    John

  • Creating views, dynamic SQL within stored procedure

    I'm having a problem with the creation of dynamic views of in a stored procedure. The following declare block works fine:

    DECLARE
    parameter i_nom_table varchar2 (200): = 'abc ';
    xyz cursor script, SELECT step
    STARTING from scripts
    WHERE table_name = i_nom_table parameter
    ORDER BY step CAD;
    l_sql scripts.script%TYPE;
    l_step scripts.step%TYPE;
    l_error VARCHAR2 (200);
    l_code VARCHAR2 (200);
    Start
    XYZ OPEN;
    LOOP
    XYZ-FETCH INTO l_step, l_sql;
    OUTPUT WHEN xyz % NOTFOUND;
    immediately run l_sql;
    insert into ingest_log values (null, sysdate, i_nom_table, l_step, l_sql, 'Success' parameter);
    END LOOP;
    CLOSE XYZ;
    insert into ingest_log values (null, sysdate, parameter i_nom_table, 0, "Accomplished all the steps.", "Success");
    EXCEPTION WHEN OTHERS THEN
    l_error: = substr (SQLERRM, 1, 200);
    l_code: = SQLCODE;
    insert into ingest_log values (null, sysdate, parameter i_nom_table, l_step, l_sql, l_code |) ' - ERROR - ' | l_error);
    END;

    However, if I create a procedure with this block and try to run it I get an insufficient privileges error. Do not know why. All tables, views, procedures are under the same user, and the user that I'm connected as the runtime of the declare block. The user has the following privileges:

    Connect, resource, xdbadmin, s/n

    Any reason you can think of for this? Script values are generally "CREATE OR REPLACE VIEW As.... » ;

    Permissions in Oracle to do indirectly through roles are not available when compiling packages, functions, and stored procedures. Direct subsidies are required during the creation of these objects in the database.

    http://articles.TechRepublic.com.com/5100-10878_11-6183799.html

  • Web ADF how to reach a view object when you click on a button

    Hi all

    I'm new to the web of the ADF
    My requirement is as follows:
    I have a page with a button print, I want when I press this button to go to a view object and specify a value in the database.

    I did a class for the managed bean and I put the following in it:

    {} public void calc (ActionEvent actionEvent)
    Add the code in the event here...
    TaskProjViewImpl t = new TaskProjViewImpl();
    t.Calculate ();
    }

    but according to me, it is not good to create an object like that, is it?
    What is the best thing to do my requirement?

    Help, please

    Your code does not work.
    Expose you the objects in view via request module (data model). It's a build data control that you use in the user interface.
    You give enough information on the use case, so all you want to do can be done without a bean.
    Open the data control build of the application module you an expand the node of the VO. You should see the method you are trying to call too in the bean. Drag onto the page and select the ADF button when asked what to create. That's all.
    This may not be exactly what you need but otherwise please describe your use cases in more detail.

    Timo

  • Views of functions or stored procedures

    Hi all

    11.2.0.3.10

    AIX6

    Y at - he views $ v for stored procedures that list the tables that are accessed by it?

    Thank you

    MK

    user_ | all_ | dba_dependencies

    You seem to specialize in issues for which you can find the answer yourself, with little effort, the so-called 'questions doc '.

    Sooner or later people here refuse to answer your questions.

    Sybrand Bakker

    Senior Oracle DBA

Maybe you are looking for

  • I can facetime to the Australia

    Can I face in time to the Australia

  • WAG120N undetected

    The router is not detected by windows (XP 32 bit) Please help Also cannot communicate with the router using 192.168.1.1 See link for info http://img706.imageshack.us/img706/9469/routererror.jpg

  • Windows experience index will not refresh

    I just installed 64-bit Windows 7 Professional (32 bit Home Premium) with a custom installation. I use aero, so when I went to check my Windows Experience index, I saw that it was 1.0 for both the graphics settings. I've updated my restarted graphics

  • PSU Q1647-60019

    Where can I get a power supply hp Q 1647-60019.

  • No recent improvement in speed of preview of updated after same construction cc

    I've just updated LR cc and note the reversion on the import facility.   However, I have imported just 28 Raw images and 28 previews Standard construction took exactly eight minutes.   However, my normal imports can be several hundreds.I understand r