How to use pl/sql procedure or function as part of validate the entity obj?

Hi,
we are migrating from oracle forms to jdeveloper 11g.
I have a req. that,i wanted to use oracle pl/sql procedure to validate a attribute in an entity created with ADF BC?
Is it possible to implement this?
And how to show the error message from pl/sql procedure?
Regards
Murali.

Hi,
It is possible by using a method validator for the entity attribute.
Create a transient attribute 'X'.
In the validation section of the attribute to be validate, choose method validator.
In the Error Message tab set error message as {0}.
Below the value for tokentoken should source.X (X is the transient attribute name)
In the java code of method validator, call the stored procedure and set the value of transient attribute X with the error message from SP.
Use setX("ErrorMessage").
Regards,
Srinidhi

Similar Messages

  • How to test PL/SQL procedures and functions?

    What are the proven ways to test pl/sql procedures and functions? Specifically, procedures and functions that take cursor variables as IN OUT parameter, OR procedure and functions that takes an array as IN parameter?
    Thx.

    HI,
    One way could by using PL/SQL Develper tool, see Tools/Test Manager...
    Also there are others tools, see [Cleaning Up PL/SQL Practices|http://www.oracle.com/technology/oramag/oracle/04-mar/o24tech_plsql.html] and specifically oUnit
    Regards,
    PS: Your question is very general, could you provide an specific example you are trying?
    Edited by: Walter Fernández on Nov 11, 2008 4:04 PM - Adding PS

  • Using PL/SQL procedure and function

    In a page i have a VO that uses a Where clause that looks like this
    WHERE attr=package.function
    where the function returns a value of an internal variable valued by another procedure in the package which considers only the Dbuser DBSchema as parameters.
    Do i have to call the procedure in a method like initializeBindigsForPage or i have to put it in another place? And in which mode?
    Thanks Marco

    hi satish,
    i tried ur suggestion, but its shows error like
    declare
    o1 number;
    total_bytes number;
    o3 number;
    unused_bytes number;
    o5 number;
    o6 number;
    o7 number;
    b number:=0;
    str varchar2(2000);
    cursor name is select TNAME FROM TAB WHERE TABTYPE='TABLE';
    begin
    FOR VAL IN name
    LOOP
    DBMS_SPACE.UNUSED_SPACE('XMLUSER',VAL.TNAME,'TABLE',o1,total_bytes,o3,unused_bytes,o5,o6,o7);
    --dbms_output.put_line(VAL.TNAME);
    --dbms_output.put_line(total_bytes);
    --dbms_output.put_line(unused_bytes);
    EXECUTE IMMEDIATE 'select count(*) from '||VAL.TNAME||' ' RETURNING into b;
    --select count(*) into b from VAL.TNAME;
    --execute immediate(str);
    dbms_output.put_line(b);
    insert into space values(VAL.TNAME,total_bytes,unused_bytes,b);
    END LOOP;
    end;
    SQL> @space.sql
    declare
    ERROR at line 1:
    ORA-06547: RETURNING clause must be used with INSERT, UPDATE, or DELETE
    statements
    ORA-06512: at line 19
    wat goes wrong satish?

  • How to find how much memory used by particular procedure or function.

    Hi,
    How can we find out memory used by particular procedure or function?
    If procedure or function is called many times in particular interver, wil it be cached in memory?
    and how will it affect performance?
    what type of pl/sql statement will take more time than normal sql statement?

    Hi
    There are several different memory issues to consider:
    - the code itself (stored in the shared pool)
    - simple variables defined in the code
    - complex variables (eg VARRAY, TABLE etc)
    There's a helpful note on PL/SQL profiling here - http://www.oratechinfo.co.uk/tuning.html - which mentions how to measure memory use (session PGA and UGA - that's program and user global areas)
    You can find out more about shared pool memory structures here - http://download-east.oracle.com/oowsf2005/003wp.pdf.
    Calling a function many times - yes, the function code will be cached (if possible). Session state (for a package) will also be retained (ie global package variables).
    If many users call the same function, there will be one copy of the code but many copies of the private state.
    Finally: PL/SQL statements that can take a long time include:
    - anything that does heavy processing inside a tight loop;
    - anything that waits (select for update; read from a pipe or dequeue from AQ etc)
    Probably the most common mistake is to use PL/SQL for relational processing that can be done from SQL itself (eg writing nested PL/SQL loops to join data that could have been queried in a single SQL statement. Try to minimise context switches between PL/SQL and SQL:
    - use bulk collect where possible
    - use set operations in SQL
    Good luck, HTH
    Regards Nigel

  • How to use PL/SQL Function after registering

    Hi,
    I have successfully registered a PL/SQL Function within Discw Admin. But i don't know how to use it further??? Please let me know the steps to use it in folders (admin) or in plus.
    Actually i have a stored procedure which fetches the records from the base tables and i have to develop a report based on that data.
    Please reply ASAP.
    Thanks,
    Jay

    Hi Jay,
    If this function is a stored procedure in the right schema, you can access this function in your custom SQL like any other database functions (e.g. SUM, AVG, MAX, etc).
    If you are not using a custom folder (ie. your own SQL), you can access this function in the workbook (Tools --> Calculations --> New Button --> Select Function Radio Button --> All Functions or Database Folders.). This calculation wil become a new column in the workbook.
    Regards,
    John

  • How to insert BLOB datatype image using PL/SQL Procedure and SQL Loader

    Hi,
    How to insert an image into database using PL/SQL Procedure and also how to insert using SQL Loader. Please help by giving sample code and process description.
    Thanks,
    Vijay V

    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:232814159006

  • How can i return object from oracle in my java code using pl/sql procedure?

    How can i return object from oracle in my java code using pl/sql procedure?
    And How can i returned varios rows fron a pl/sql store procedure
    please send me a example....
    Thank you
    null

    yes, i do
    But i can't run this examples...
    my problem is that i want recive a object from a PL/SQL
    //procedure callObject(miObj out MyObject)
    in my java code
    public static EmployeeObj callObject(Connection lv_con,
    String pv_idEmp)
    EmployeeObj ret = new EmployeeObj();
    try
    CallableStatement cstmt =
    lv_con.prepareCall("{call admin.callObject(?)}");
    cstmt.registerOutParameter(1, OracleTypes.STRUCT); // line ocurr wrong
    //registerOutParameter(int parameterIndex, int sqlType,String sql_name)
    cstmt.execute();
    ret = (EmployeeObj) cstmt.getObject(1);
    }//try
    catch (SQLException ex)
    System.out.println("error SQL");
    System.out.println ("\n*** SQLException caught ***\n");
    while (ex != null)
    System.out.println ("SQLState: " + ex.getSQLState ());
    System.out.println ("Message: " + ex.getMessage ());
    System.out.println ("Vendor: " + ex.getErrorCode ());
    ex = ex.getNextException ();
    System.out.println ("");
    catch (java.lang.Exception ex)
    System.out.println("error Lenguaje");
    return ret;
    Do you have any idea?

  • How to check if column_ name is used by any procedure ,package ,function

    Hello
    Help Is greatly appreciated .
    Kindly please let me know for the folllwoing:
    How to check if column_ name is used by any procedure ,package ,function ,trigger or in any dataabse objects

    >
    How to check if column_ name is used by any procedure ,package ,function ,trigger or in any dataabse objects
    >
    In general you can't. Code can always exist outside the database and it is always possible that you have dynamic code and there is no way to find references like that if used by dynamic code. That dynamic code reference could be based on a query stored in a table.
    And there is no way of knowing if external code (e.g. a Java app) references that column.
    Another issue is that a column could exist in multiple schemas and in multiple objects of different types in those schemas. So a global DB search for 'MY_COLUMN' might turn up references in multiple schemas and you may only care about one schema.
    Unfortunately a reference to 'MY_COLUMN' in code could refer to many different objects or to an object in different schemas so how would you resolve those? Especially if you take synonyms into account which can ponit about anywhere.
    Why don't you tell us what it is you are really trying to do?
    Are you trying to find the references to a particular column? Why? Are you planning on removing/renaming the column? If so then the simplest way is to remove/rename the column and see what objects become invalid. Those invalid objects will have become invalid because that column is no longer available.
    As suggested you can use DBA_SOURCE for references in code that use the standard names. But for tables/views you need to use all_tab_columns. And for dynamic code or client code (e.g. a Java application) there is no way.

  • Call a PL/SQL procedure or function from applet

    Could anyone please let me know how I could call a PL/SQL procedure
    or function from a JDBC method from applet with Internet Explorer?

    It depends from where you are calling your PLSQL routine. If it is SQL*Plus then you can use & (ampersand) with the variable to be input at run time.
    If you are executing the PLSQL routine from another application (some front end application) then it's not possible. Because when a procedure is executing at server side, the front end application does not have control, and the control is only transfered back to front end application when the PLSQL routine either completes successfully or throws an exception.
    In either case, you can not go back to the PLSQL routine.
    In this case, what you can do is, write code in your front end application to get that variable value from user and then pass that value to PLSQL routine.

  • Are the Pl/sql procedure and function atomic by themself

    i want to ask a question does oracle pl/sql procedure and function support Atomicity for the database by themself , or they became atomic incase we call them using begin -- end;

    You appear to be discussing transaction scope which is completely independent of PL/SQL blocks like procedures or how you call procedures. It's all in where commits (or rollbacks) are issued.
    If you have a procedure like this
    CREATE PROCEDURE p1
    AS
    BEGIN
      INSERT INTO some_table( key, value ) VALUES( 1, 'Foo' );
      INSERT INTO some_table( key, value ) VALUES( 1, 'Bar' );
    END;where the first statement succeeds and the second statement fails as a result of a duplicate key, there will still be a Foo row in the table but the procedure will have thrown an exception. The caller of the procedure may choose to commit or rollback the change-- that will determine whether the first statement's results are made permanent. If you have a procedure like this,
    CREATE PROCEDURE p1
    AS
    BEGIN
      INSERT INTO some_table( key, value ) VALUES( 1, 'Foo' );
      commit;
      INSERT INTO some_table( key, value ) VALUES( 1, 'Bar' );
    END;the commit will make the first insert permanent regardless of whether the second statement fails no matter what the calling code does (that's one reason that putting commits in stored procedures is generally a bad idea-- the caller is in a much better position to know what other uncommitted work has been done and whether it is safe to commit.
    Justin

  • How to use a stored procedure in oracle reports

    How to use a stored procedure in oracle reports

    Dear,
    In report triggers you can write your procedure/functions or call it like
    function AfterPForm return boolean is
    begin
    myprocedure(:mydate);
    return (TRUE);
    end;
    Thanks
    Jamil

  • Display data in log file using PL/SQL procedure

    Just as srw.message is used in Oracle RDF Reports to display data in log file in Oracle Apps, similarly how it is possible to display data in log file using PL/SQL procedure?
    Please also mention the syntax too.

    Pl post details of OS, database and EBS versions.
    You will need to invoke the seeded FND_LOG procedure - see previous discussions on this topic
    Enable debug for pl/sql
    https://forums.oracle.com/forums/search.jspa?threadID=&q=FND_LOG&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    HTH
    Srini

  • How to use Native SQL statement in JDBC receiver interface

    Dear All,
    Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    Select Field1 Field2 from TABLE Where Field3 like "%Name'
    I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    Hence I need to know:-
    1. What message mapping I should use in case if I have to use Native SQL statement.
    2.What operation mapping I should use in case if I have to use Native SQL statement.
    If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    3 .How do to go about it to do the Java mapping.
    Thanks
    Ameet

    >
    Ameet Deshpande wrote:
    > Dear All,
    >
    > Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    >
    > "
    > Select Field1 Field2 from TABLE Where Field3 like "%Name'
    > "
    > I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    >
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    >
    > The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    >
    > Hence I need to know:-
    >
    > 1. What message mapping I should use in case if I have to use Native SQL statement.
    > 2.What operation mapping I should use in case if I have to use Native SQL statement.
    > If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    > 3 .How do to go about it to do the Java mapping.
    >
    > Thanks
    > Ameet
    You can use a stored procedure, and call it from jdbc receiver adapter.
    I also solve this issue, with a DBLookup in message mapping. You can refer to my blog, and this usefull 3d:
    http://simonlesflex.wordpress.com/2010/12/07/pi-oracle-dblookup/
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

  • Retrive perticular mail using PL-SQL procedure

    Hi all,
    Anyone knows, how to retrive mails from outlook using PL-SQL procedure?
    Thanks and Regards
    Nilay

    The Java library needed by UTL_TCP is not created properly. You may just run $ORACLE_HOME/rdbms/admin/initplsj.sql as SYS to install it:
    cd $ORACLE_HOME/rdbms/admin
    sqlplus sys/<sys-password> @initplsj.sql

  • How to Use Dynamic SQL

    Can anybody please send me a small program on How to Use Dynamic SQL.
    How to execute and run give details.
    Thanks
    null

    You can certainly use the INTO (and USING) clauses of EXECUTE IMMEDIATE to pass in and return data, i.e.
    EXECUTE IMMEDIATE sqlStmt
      USING variable1, variable2
       INTO output1, output2The more complex the statement, however, the more appropriate DBMS_SQL is. DBMS_SQL also has the potential to allow you to use bind variables rather than reparsing the statement many times.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for