Wrong  value  in java stored function

Hi All,
i have written a java stored function,
at the end of the code it insert record into the database
among other columns also a number(18,3) column,
when I debug it (out side of server) - works fine.
when I load it to database i get wrong values in column
(like instead of 76.546 i get 77.667) I can't figure out where it comes from.
I use big decimal in java code.
if i Hard code the value in java code it works fine!
am I missing something ?, calculations/ data type different out side then inside database? using oracle 10.2.0.2
Cheers
Sahar

Hi
the code calculate some averages of amounts ( money) according to several
conditions,and parameters given to the function and stores the average into table in the database
the money columns are of data type 18,3 , both source and target tables have same structure.
thanks
Sahar

Similar Messages

  • Return 2 values (string, number) multiple rows, from java stored function

    I would like to return 2 values (String, number prefered but String, String will work) from a java stored function.
    I was able to successfully return a varray of varchar2 values but I was wondering if it is possible to return 2 values by using a varray?
    Is it even possible? I tried using combinations of types which included a varray of objects (with 2 attributes) or a type as table of objects but I couldn't figure out how in my java code to set these values. Also what would my java function return type be and what Oracle type would map to it?
    Any help and examples or pointers would be great.
    Thanks,
    Dennis

    Thanks to all. I finally figured it out through all the pieces on the web.
    Here is what worked for me. First create 2 oracle types. One object type to represent the "columns" I will pass back:
    CREATE OR REPLACE TYPE COST_OBJ AS OBJECT (COST_NAME NVARCHAR2(50), COST_VALUE number ) NOT FINAL
    note: make sure the "strings" are defined as NVARCHAR2 or Java will puke if it is just VARCHAR2.
    Then create a table type to hold your objects defined as following:
    CREATE OR REPLACE TYPE COST_OBJ_TABLE is table OF COST_OBJ
    Then create the oracle stored function that is a wrapper to the java function:
    CREATE OR REPLACE FUNCTION get_Costs(Name VARCHAR2, evalDate VARCHAR2, fuelCodeID NUMBER) return COST_OBJ_TABLE
    is language java name
    'com.costs.storedProcedures.Cost.getCosts(java.lang.String, java.lang.String, int) return oracle.sql.ARRAY'
    Once that is done, Oracle is ready. The Java function looks something like this:
    public ARRAY getCosts(String name, String evalDate, int fuelCodeID) {
    DBAccess da = getDBAccess();
    // get a handle on the connection
    Connection conn = da.getConnection();           
    // The stuff that will be returned should be as type object array
    // make it to the size of the number of fuelcomponents passed in
    Object[] returnStuff = new Object[3];
    // create the type of struct that is defined on the database
    StructDescriptor structDesc =
    StructDescriptor.createDescriptor("CY_UMAP.COST_OBJ", conn);
    for (int i = 0; i < returnStuff .size(); i++) {
    Object[] costValues = new Object[]{
         "This is object " + i,
         new Integer ( i ) };
    STRUCT cost_obj = new STRUCT(structDesc, conn, costValues);
    returnStuff[i] = cost_obj;
    ArrayDescriptor x_ad = ArrayDescriptor.createDescriptor (
    "CY_UMAP.COST_OBJ_TABLE", conn);
    ARRAY x_array = new ARRAY(x_ad, conn, returnStuff);
    return x_array;
    I hope this helps others.
    Dennis

  • Why returning string from java stored function failed ?  HELP ME, PLEASE

    Hi everybody,
    I created java stored function: it's doing http post, parsing xml from http reply, and returning string result.
    Sometimes, it doesn't return any value. What can be a reason ?
    The high level procedure, has following form:
    class SBE {
    public static String call(String arg0) {
    SBE sbe=new SBE("d:\\oracle\\ora81\\network\\log\\SBE.log");
    String result=SBEParser.go(sbe.sendRequest(arg0, ""), sbe.logger);
    sbe.logger.log(result);
    sbe.logger.log("Finish SBE intetraction");
    return result;
    PLSQL wrapper has a simple form:
    create or replace package PG_SBE as
    function CALL(arg0 in varchar2) return varchar2;
    end;
    create or replace package body PG_SBE as
    function CALL(arg0 varchar2) return varchar2 as language java name 'SBE.call(java.lang.String) return java.lang.String';
    end;
    In log file ("d:\\oracle\\ora81\\network\\log\\SBE.log"), I can find message :
    "Finish SBE intetraction"
    but query:
    select pg_sbe.call("any argument") from dual;
    doesn't finish.
    What can be a reason ? What can I do to trace stage of convertion java string to varchar ?
    Please help me...
    Best regards
    Marek

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Stefan Fdgersten ([email protected]):
    Maybe your call is wrong... Shouldn't there be a "?" instead of "1"?
    Your code:
    String myquery = "begin :1 := jspTest; end;";
    I provide my (working) call from java as an example. Maybe it is of any help... :)
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public Vector getAllHosts() throws SQLException {
    //return getHosts(false, -1);
    Connection conn = null;
    CallableStatement cs = null;
    Vector hostV = new Vector();
    try {
    conn = getConnection();
    String query = "{ ? = call curTestPkg.curTestFunc}";
    cs = conn.prepareCall(query);
    cs.registerOutParameter(1, OracleTypes.CURSOR);
    cs.execute();
    ResultSet rs = ((OracleCallableStatement)cs).getCursor(1);
    while (rs.next()) {
    Host host = new Host(
    rs.getInt("hostid")
    , rs.getString("name")
    , rs.getString("descr")
    , rs.getString("os"));
    hostV.add(host);
    cs.close();
    return hostV;
    } finally {
    close(conn, cs);
    <HR></BLOCKQUOTE>
    hi Stefan thanx.....even after changing the call statement i get the same error. i changed query string as...
    String myquery = "{ ? = call jspTest}";
    CallableStatement cst = con.prepareCall(myquery);
    Can u please check out my call sepc that i have written in pl/sql and plz let me know it there is any error in that.
    PS : THIS IS THE FIRST TIME I AM WORKING WITH PL/SQL AND IT IS URGENT

  • Why returning string from java stored function failed ?

    I created java stored function: it's doing http post, parsing xml from http reply, and returning string result.
    Sometimes, it doesn't return any value. What can be a reason ?
    The high level procedure, has following form:
    class SBE {
    public static String call(String arg0) {
    SBE sbe=new SBE("d:\\oracle\\ora81\\network\\log\\SBE.log");
    String result=SBEParser.go(sbe.sendRequest(arg0, ""), sbe.logger);
    sbe.logger.log(result);
    sbe.logger.log("Finish SBE intetraction");
    return result;
    PLSQL wrapper has a simple form:
    create or replace package PG_SBE as
    function CALL(arg0 in varchar2) return varchar2;
    end;
    create or replace package body PG_SBE as
    function CALL(arg0 varchar2) return varchar2 as language java name 'SBE.call(java.lang.String) return java.lang.String';
    end;
    In log file ("d:\\oracle\\ora81\\network\\log\\SBE.log"), I can find message :
    "Finish SBE intetraction"
    but query:
    select pg_sbe.call("any argument") from dual;
    doesn't finish.
    What can be a reason ? What can I do to trace stage of convertion java string to varchar ?
    Please help me...
    Marek

    This comes up periodically. It just isn't possible using that type of approach. Probably the best you could do is the create an ADT (containing collections) and use that to pass a 'batch' of information.
    Hopefully this will get addressed in the next release of the database.

  • Recursing through table / complex return types in Java Stored Functions

    I have a table representing a tree with arbitrary depth, of the form:
    ID NUMBER(10) PRIMARY KEY,
    NAME VARCHAR2(20),
    PARENT NUMBER(10)
    with PARENT being a foreign key for ID, so that top-level nodes in the tree have a NULL PARENT, and other nodes have the ID of their parent node in the PARENT field.
    I want a good way to get a row representing a node as well as all its ancestor nodes recursively up to the top level. I do this a lot in my Java application, and right now it works by just getting each row, checking if PARENT is null, and recursing again until I get the top-level node. Since this recursion is in Java and I do multiple queries it's rather slow, and I'd rather perform this operation in the database (using a Java Stored Function/Procedure or PL/SQL).
    I'm no good at PL/SQL so don't have a clue how to go about doing this sort of thing, and although I can write a Java Stored Function that does the same recursion I do in the application, I don't know how to return the results. I can't return a REF CURSOR type since the results are from multiple queries, and I can't find any documentation about how to return structured types from a JSF.
    If anyone could give me a near-complete PL/SQL listing that does this or (better) help me to complete my Java Stored Function by returning the results in a structured type.

    You are my own personal God (for the day). Thanks, exactly what I needed, and all in one query with no procedural.

  • How to return custJava Object from Java Stored Function/Procedure to Java Application

    I WILL PAY $100 FOR SOLUTION.
    Oracle JDBC documentation gives step by step on how to return Oracle Type Object to Java Application. No question here.
    But is it possible to create Java Stored Function [getMyClass() ] which returns CUSTOM Java based object [MyClass] to Java application like:
    //java stored function
    class Foo
    public static MyClass getMyClass()
    return new MyClass();
    //java class I want to return to Java
    class MyClass
    public String getGreetings(String name)
    return "Hello " + name;
    I tried to do it using intermittent Oracle
    Type Object and OracleConnection map to make binding between Java->Oracle->Java. I could
    not get throgh meaningless run time ORA Errors. Any kind of help would be greatly
    appreciated. If you know the answer please
    post it or e-mail [email protected]
    null

    You don't say which version of the database you are on. There's an interesting looking article on OTN on handling CLOBs in JDBC in 10g. It may well be useful for earlier versions too (but no guarantees).
    Cheers, APC

  • How can i return a SDO_GEOMETRY value in a Java-Stored-Function?

    For a example, Ive got a java-function witch returns a
    oracle.sdoapi.geom.Geometry like:
    public static Geometry GetQPoint(String sF_TABLE_NAME, long lFID)
    And now, Ill try to deploy this function as a PL-SQL stored-function like:
    GET_Q_POINT(
    F_TABLE_NAME IN VARCHAR2,
    FID IN NUMBER
    ) RETURN MDSYS.SDO_GEOMETRY;
    I can't deploy this above mentioned java-function with Oracle9i JDeveloper because oracle.sdoapi.geom.Geometry can not mapped in any PL-SQL data type.
    Is there any possibility to do it in a other way?
    Please help me.

    a quick example that takes as input a longitude and latitude,
    and return a point geometry in wgs 84:
    CREATE OR REPLACE FUNCTION get_geom (
         longitude IN          NUMBER,
         latitude     IN          NUMBER )
         RETURN mdsys.sdo_geometry
         DETERMINISTIC IS
         BEGIN
    RETURN mdsys.sdo_geometry (2001,8307,
              mdsys.sdo_point_type (longitude, latitude, NULL), NULL, NULL );
    END;
    other pl/sql examples:
    REM
    REM This function doesn't really do anything, but demonstrates some simple
    REM mechanisms on how to manipulate the array portion of the geometry object, and
    REM also how to write a function that returns a geometry object.
    REM
    REM The function demonstrates:
    REM 1) .EXTEND (there is also .DELETE)
    REM 2) .COUNT
    REM 3) Any function that returns an object (including the SDO_GEOMETRY object)
    REM should be declared as DETERMINSTIC (see below).
    REM
    create or replace function create_geometry return mdsys.sdo_geometry deterministic as
    temp_geom mdsys.sdo_geometry := mdsys.sdo_geometry (2002, 8307, null,
    mdsys.sdo_elem_info_array (1,2,1),
    mdsys.sdo_ordinate_array ());
    begin
    for i in 1 .. 10 loop
    temp_geom.sdo_ordinates.extend (2);
    temp_geom.sdo_ordinates(temp_geom.sdo_ordinates.count-1) := i;
    temp_geom.sdo_ordinates(temp_geom.sdo_ordinates.count) := i+1;
    end loop;
    return temp_geom;
    end;
    select create_geometry from dual;
    set linesize 80
    set pages 1000
    drop table TEST_MODIFY;
    create table TEST_MODIFY (geom mdsys.sdo_geometry);
    insert into TEST_MODIFY values
    (mdsys.sdo_geometry (2002, 8307, null,
    mdsys.sdo_elem_info_array (1,2,1),
    mdsys.sdo_ordinate_array (1,1, 2,2, 3,3, 4,4)));
    insert into TEST_MODIFY values
    (mdsys.sdo_geometry (2002, 8307, null,
    mdsys.sdo_elem_info_array (1,2,1),
    mdsys.sdo_ordinate_array (21,21, 22,22, 23,23, 24,24)));
    REM
    REM Select values before update.
    REM
    select geom from TEST_MODIFY;
    REM
    REM This PL*SQL block updates all the ordinates of a geometry by adding 10 to each x value
    REM and 20 to each y value.
    REM
    declare
    i NUMBER;
    cursor c1 is select geom, rowid
    from TEST_MODIFY;
    begin
    for r in c1 loop
    i := 1;
    while (i < r.geom.sdo_ordinates.count) loop
    r.geom.sdo_ordinates(i) := r.geom.sdo_ordinates(i) + 10;
    r.geom.sdo_ordinates(i+1) := r.geom.sdo_ordinates(i+1) + 20;
    i := i + 2;
    end loop;
    update TEST_MODIFY set geom = r.geom where rowid = r.rowid;
    end loop;
    end;
    REM
    REM Select values after update.
    REM
    select geom from TEST_MODIFY;

  • Dynamicly change SelectOneRadio value in java script function -- Please hel

    Hello, I need to change SelectOneRadio value within a javascript function. But it doesn't seem to work for me. Can someone tall me what I did wrong or how to get this?
    Thanks a lot!
    I have :
    <h:panelGrid Columns="3">
    <h:selectOneRadio id="myRadio", value="#{myBean.radioOption}" />
         <f:selectItems value="#{myBean.radioOptionList}" />
    </h:selectOneRadio>
    </h:panelGrid>
    <script >
    function needToChangeRadioValue(choice){
    if ( choice == something ) { 
         document.getElementById("myForm:myRadio").value="1"; //doesn't really work
         document.getElementById("myForm:myRadio").immediate="true";
    } else if ( choice == somethingelse ) {
         document.getElementById("myForm:myRadio").value="2"; //doesn't really work
         document.getElementById("myForm:myRadio").immediate="true";
    } else {
         document.getElementById("myForm:myRadio").value="3"; //doesn't really work
         document.getElementById("myForm:myRadio").immediate="true";
    </script>
    -- java --
    ArrayList radioOptionList;
    public ArrayList getRadioOptionList(){
         radioOptionList = new ArrayList();
         radioOptionList.put("1","Option1");
         radioOptionList.put("2","Option2");
         radioOptionList.put("3","Option3");
         return radioOptionList;
    }

    Thank you for the quick response!
    Does it work for you? I tryed getElementsByName("myform:myRadio")[1].value="1"; No errors but the screen doesn't show that radio button is "on". I also created another function to go through the form object and try to set the attribute but no luck. From screen, I still don't see the option is selected(or on). I have :
    <script .... >
    function checkRadioButton(){
    var allElem = document.forms['myform'].elements;
    for ( i=0 ; i< allElem.length; i++ ){
    alert("element name = " + allElem.name ); // I see myform:myRadio three times
    alert("element id = " + allElem[i].id ) // when name="myform:myRadio, id is null/empty
    alert("element value = "+ allElem[i].value ); // when name="myform:myRadio, value = 1, 2, 3 respectively
    if ( allElem[i].name == 'myform.myRadio' ) {
         var attributes = allElem[i].attributes;
    for ( j =0; j < attributes.length; j++) {
              if ( attributes[j].name == 'CHECKED' ) { // I found CHECKED is one of selectOneRadio's attributes
                   if ( i == 1) {
         attributes[j].value = true; // It still doesn't work. I didn't see that option1 get selected/on.
    What I am trying to do is common, I think !!?? Really appreciate your help.

  • ORA-29531 when i execute a java stored function

    I get the following error when i tried to execute java stored procedure
    ORA-29531: no method secondConcat in class secondProcedure
    The code below will explain my problem clearly
    Java Class:(secondProcedure)
    import java.lang.*;
    public class secondProcedure
    public static String secondConcat(String inStr1, String inStr2, String outStr)
    System.out.println("Calling secondProcedure.secondConcat\n");
    outStr = inStr1 + inStr2;
    String retStr = outStr;
    return retStr;
    Database Function:(fn_sec_concat)
    FUNCTION fn_sec_concat(Str1 IN VARCHAR2, Str2 IN VARCHAR2, Str3 OUT VARCHAR2)
    RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'secondProcedure.secondConcat(java.lang.String, java.lang.String, java.lang.String[])
    return java.lang.String';
    I used loadjava utility to load the java class into database which went fine.
    I searched for the error message on the web, & i response i got from everywhere is to add the static attribute to method, which was already there in my code.
    Please help!
    null

    I get the following error when i tried to execute java stored procedure
    ORA-29531: no method secondConcat in class secondProcedure
    The code below will explain my problem clearly
    Java Class:(secondProcedure)
    import java.lang.*;
    public class secondProcedure
    public static String secondConcat(String inStr1, String inStr2, String outStr)
    System.out.println("Calling secondProcedure.secondConcat\n");
    outStr = inStr1 + inStr2;
    String retStr = outStr;
    return retStr;
    Database Function:(fn_sec_concat)
    FUNCTION fn_sec_concat(Str1 IN VARCHAR2, Str2 IN VARCHAR2, Str3 OUT VARCHAR2)
    RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'secondProcedure.secondConcat(java.lang.String, java.lang.String, java.lang.String[])
    return java.lang.String';
    I used loadjava utility to load the java class into database which went fine.
    I searched for the error message on the web, & i response i got from everywhere is to add the static attribute to method, which was already there in my code.
    Please help!
    null

  • Read item from Java class and call to stored function/procedure of database

    Hi,
    I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
    I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
    question1: How can I read jsp pages items value to java class ?
    question2: How can I call to database stored function/procedure with that parameter?
    question3: How can I use return value of that stored function/procedure ?
    Please reply me .
    Thanks,
    zakir
    ===
    Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM

    ---

  • Getting result of stored functions in UCM components

    Hi,
    I have to create UCM component that executes function stored in DB and somehow "inject" it's return value to iDoc.
    How can I get return value of DB stored function?
    I managed to run the function, but I can not get it's return value.
    The only documentation I found is inside "documentation" folder from HowToComponents bundle, but there is no even javadoc for executeCallable that returns CallableResults.
    The queries I used are:
    { ? = call package.func(?) }
    or
    BEGIN ? := package.func(?); END;
    I added 2 parameters to these queries ( in queries html file)
    In both cases the function gets executed (I see changes in DB)
    after the execution I try to getInteger("param1_name") on returned CallableResults and recieve NullPointerException:
    Runtime error: java.lang.NullPointerException
    at oracle.jdbc.driver.OracleCallableStatement.getInt(OracleCallableStatement.java:1119)
    at intradoc.jdbc.JdbcCallableResults.getData(JdbcCallableResults.java:203)
    at intradoc.jdbc.JdbcCallableResults.getInteger(JdbcCallableResults.java:98)
    at DatabaseProvider.DatabaseProviderHandler.executeReservation(DatabaseProviderHandler.java:224) <------ calling getInteger("param1_name")
    the param1_name is not changed in iDoc.
    Thanks.
    Edited by: dpd on Jan 13, 2010 8:24 AM

    Hi,
    you can do this with just one script object.
    For example the "MyTexts" script object with the string variables and a function to return the values.
    var infotext1 = "Lorem ipsum dolor sit amet"
    var infotext2 = "Non eram nescius Brute cum"
    function getText(FieldNumber) {
              return eval("infotext" + FieldNumber);
    To populate a field you can call the function in the script object with an argument, which is the alias for the varaible number you want to return.
    You don't need to enter the full somExpression to your script object, the name is enough.
    Textfeld1.rawValue = MyTexts.getText(1);

  • Problem with return value of stored function

    Hi,
    I've made a stored function that insert a new row in a table and return the primary key (see at the end of the message the function script).
    In VS 2005 with Visual basic, using the designer, I've created a dataset containing a tableAdapter to be able to use the Pl/SQL function.
    My problem is I can't get the proper return value. The VB code below works without error except that I get 0 as value.
    What's wrong?
    Cheers,
    Sebastien
    VB code
    Dim myAddSession As New ICISDataSetTableAdapters.AddSessionTableAdapter
    Dim intSessionId As Integer
    intSessionId = myAddSession.ADD_SESSION(tbxUsername.Text, _
    tempFolder.Substring(tempFolder.LastIndexOf("\") + 1), _
    "toto", Environment.GetEnvironmentVariable("COMPUTERNAME"), _
    myLevelAccess.icisUserId, myLevelAccess.levelId)
    The debugger tells me that the ADD_SESSION function return value is Object.
    add_session PL/SQL script:
    CREATE OR REPLACE FUNCTION ICISSEC.add_session (
    orausername IN icis_session.ora_user_name%TYPE,
    ctxsessionid IN icis_session.ctx_session_id%TYPE,
    ctxsessionname IN icis_session.ctx_session_name%TYPE,
    ctxservername IN icis_session.ctx_server_name%TYPE,
    icisuserid IN icis_session.icis_user_id%TYPE,
    startlevelid IN icis_session.start_lvl_id%TYPE
    RETURN icis_session.ICIS_SESSION_ID%TYPE
    IS
    tmpvar icis_session.ICIS_SESSION_ID%TYPE;
    BEGIN
    INSERT INTO icis_session
    (ora_user_name, ctx_session_id, ctx_server_name,
    icis_user_id, start_lvl_id, ctx_session_name
    VALUES (orausername, ctxsessionid, ctxservername,
    icisuserid, startlevelid, ctxsessionname
    RETURNING icis_session_id
    INTO tmpvar;
    COMMIT;
    RETURN tmpvar;
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END add_session;

    naama wrote:
    that if a value is null to convert it to 0 ? . i mean in the part of the declaration of parameter
    Nope, can't do that in the signature. You'll need to handle that by validating the passed parameters at the start of the function.
    It's simple enough. In your case you might just as well test for NULL and fail the function like this:
        FUNCTION date_post_message(
                user_lock_in IN NUMBER,
                form_type_in IN NUMBER DEFAULT 0 ,
                date_in      IN DATE)
            RETURN BOOLEAN
        IS
            v_num NUMBER(1);
        BEGIN
            dbms_output.put_line('Value of parameters : user_lock_in : '||user_lock_in || ' : form_type_in : '||form_type_in||' : date_in : '||date_in );
            IF user_lock_in = 1 THEN
                RETURN FALSE;
            END IF;
            IF form_type_in IS NULL THEN
                RETURN FALSE;
            ELSIF form_type_in NOT IN (1,2) THEN
                RETURN FALSE;
            END IF;
            RETURN TRUE;
        EXCEPTION
        WHEN NO_DATA_FOUND THEN
            RETURN FALSE;
        END;In other use cases I would declare a local variable and process it like this:
            IF form_type_in IS NULL THEN
                l_form_type := 0;
            ELSE
                 l_form_type := form_type_in;
            END IF;Obviously the code should use the local variable rather than the parameter.
    Validating the values passed in parameters at the start of a function is good practice. If you really want to go to town, read about Design By Contract.
    Cheers, APC
    Edited by: APC on Nov 9, 2011 1:36 PM
    Added example, as requested by OP

  • Java stored proc. malformed values in numeric Datafield ...

    The java stored procedure functiones well, if it access tables that are on the same server.
    Retrieving Data from numeric field of a resultset will result in malformed numeric values , if the table I access it on another server.
    like sms.tabname@server.
    No matter , which methods I use
    rset.getBigDecimal , rset.getFloat /these will retrieve sometimes values with 20 to 40 digits!.
    Maybe some NLS related problem ?

    Hi,
    Which RDBMS release/version are you using (and whish one is the target)?
    Kuassi, http://db360.blogspot.com

  • Java Stored Procedure functions in SQL DML - multiple invocations

    When running a java stored procedure as part of a DML statement the procedure is invoked 10-15 times for each row that is updated.
    For example:
    Update mytable set mycolumn = myjsp(somecolumn);
    I undertand that this was a known bug with the JDBC driver. Has it been fixed? Is there a workaround?
    We are using 8.1.6 on NT 4
    Thanks
    Julian

    Hello ,
    I tried here, and it seems to call the function once for each row
    eg :
    package package90;
    public class Class1 extends Object {
    public int get_data(int i)
    return i+10;
    Published the get_data function as
    myproject67.get_data
    SQL> connect scott/tiger@orcl8i
    Connected.
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(5000);
    PL/SQL procedure successfully completed.
    SQL> select * from test_java;
    NO1
    10
    10
    SQL> insert into test_java values (20);
    1 row created.
    SQL> select * from test_java;
    NO1
    10
    10
    20
    SQL> update test_java set no1=myproject67.get_data(no1);
    Called
    Called
    Called
    3 rows updated.
    SQL> select * from test_java;
    NO1
    20
    20
    30
    SQL>

  • Calling Stored function and showing returned value on the UI screen

    I am calling a stored function by using the following steps mentioned as per the below link. The stored function returns a single scalar value
    http://download.oracle.com/docs/cd/E1790401/web.1111/b31974/bcadvgen.htm#sm0297_
    Please verify if I am putting the code in the classes as required by the ADF framework.
    * 1) In class CustomApplicationModuleImpl extends ApplicationModuleImpl*
    // Some constants
    public static int NUMBER = Types.NUMERIC;
    public static int DATE = Types.DATE;
    public static int VARCHAR2 = Types.VARCHAR;
    protected Object callStoredFunction(int sqlReturnType, String stmt,
    Object[] bindVars) {
    CallableStatement st = null;
    try {
    // 1. Create a JDBC CallabledStatement
    st = getDBTransaction().createCallableStatement(
    "begin ? := "+stmt+";end;",0);
    // 2. Register the first bind variable for the return value
    st.registerOutParameter(1, sqlReturnType);
    if (bindVars != null) {
    // 3. Loop over values for the bind variables passed in, if any
    for (int z = 0; z < bindVars.length; z++) {
    // 4. Set the value of user-supplied bind vars in the stmt
    st.setObject(z + 2, bindVars[z]);
    // 5. Set the value of user-supplied bind vars in the stmt
    st.executeUpdate();
    // 6. Return the value of the first bind variable
    return st.getObject(1);
    catch (SQLException e) {
    throw new JboException(e);
    finally {
    if (st != null) {
    try {
    // 7. Close the statement
    st.close();
    catch (SQLException e) {}
    With a helper method like this in place, calling the func_with_no_args procedure shown in Example 37-7 would look like this:
    *2) In class CustomServiceImpl extends CustomApplicationModuleImpl*
    public String callEnvironmentName(){
    return (String) callStoredFunction(VARCHAR2, "CAR_UTIL_PK.get_environment_name()", new Object[] {});
    3) If I have the first two steps correct, I was to display the value returned by method callEnvironmentName() with scalar values like (Development, Production etc) at the footer of each JSFX page. What is the flow I should follow, should I call callEnvironmentName() from some managed bean? Also I want to store it once on first call to some application variable and use that to populate the JSFX pages. Is there a working example. What is the best practice?
    Thanks
    Edited by: user5108636 on Apr 5, 2011 11:58 PM

    Hi John,
    Duplicate alerts are coming for BP_Confirmed as well as one custom event. Earlier I thought there is some issue with my custom event, but when it came for BP_Confirmed also, then i have a doubt something is wrong with the application.
    I have also checked that BP_Confirmed is being raised only once inside the method-BP_CONFIRM of class-cl_crmcmp_b_cucobupa_impl.
    raise event BPConfirmed
      CLASS cl_crm_ic_services DEFINITION LOAD.
      CREATE OBJECT event.
      event->set_name( if_crm_ic_events_con=>gc_bpconfirmed ).
      event_srv = cl_crm_ic_services=>get_event_srv_instance( ).
      event_srv->raise( event ).
    Are you aware of any other place from where this event is getting triggered?
    Thanks for your help!
    Regards,
    Rohit

Maybe you are looking for

  • Solaris 8 on SPARC

    Does anyone know if it possible to install Solaris 8 on a 1GB disk and still retain CDE? If so which options should be selected during the installation?

  • Purchase order as a control

    can anyone tell me all those t.codes from where i can make purchase order a required field. i want to have control through purchase order. is it possible to have control if i make sorting key 014 in vendor recon account. and fsg g067 contains purchas

  • Best way to migrate Access data into Oracle 10g?

    what's the best and easiest way to migrate MS Access database into Oracle10g? Thanks

  • Can't open CS2 image with photoshop

    I had this camera, Canon 50d, for little more than two years. Now it is time to start working with Raw image and can't open the image with Photoshop. But I could open with EOS utility but want to work with Photoshop. thanks for reading and advice ple

  • Implements Comparable

    I am trying to create a holder object, which holds two values. It is called TwoTuple. I implemented Comparable so that I can use it in a Set. public class TwoTuple<A,B> implements  Comparable<TwoTuple>{      public final String first;      public fin