Null ConnectionRequestInfo on call to ManagedConnectionFactory.matchManagedConnections

          Hi,
          I think my problem is probably similar to post 954.
          I have deployed a resource adapter and a session bean that uses the adapter. The
          session bean has the following reference to the resource (in ejb-jar.xml)
          <resource-ref>
          <description><![CDATA[This is a reference to the JDBCAdapter RA]]></description>
          <res-ref-name>eis/MyJDBCConnector</res-ref-name>
          <res-type>jdbcAdapter.ConnectionFactoryAdp</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>
          I have a plain vanilla java client which passes its credentials to the session
          bean on the JNDI context lookup e.g:
          try
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
          env.put(Context.PROVIDER_URL,"t3://localhost:7001");
          env.put(Context.SECURITY_PRINCIPAL, "TestUser");
          env.put(Context.SECURITY_CREDENTIALS, "testuser");
          ctx = new InitialContext(env);
          home = (dbSQLAccessHome)PortableRemoteObject.narrow(
          ctx.lookup("testAdapterEJB"),dbSQLAccessHome.class);
          db = home.create();
          this all works fine and I can use getCallerPrincipal() on the session bean to
          validate that my client is as expected.
          I have configured the appropriate WLS user and the corresponding credential mapping
          to the EIS using the default credential mapper.
          All appears well, until the container calls ManagedConnectionFactory.matchManagedConnections()
          it passes a null ConnectionRequestInfo object and hence the match fails.
          What have I missed? As a test, I supply default credentials in the ra.xml descriptor
          and create an initial connection which works okay, so I believe there is something
          amiss with my container config. Any advice gratefully received!
          Many Thanks,
          Andrew.
          

no.
java will call shell script..shell script will do some sql opearation by connecting to database.
i want to see check that if sql query is executed fine if yes..return some value to shell and the shell wil return value to java code.
i have added code...could u please update it ?
(previous i.e. 1st message)

Similar Messages

  • Credit Classification is null in the call to create credit request api

    Hi All,
    We are currently working on the implementation of Credit Management module. The plan is to integrate it with Orders Management. When an order is created above a specified credit limit for a customer, a credit review request is submitted. This is done from Order Management side through the seeded procedure OE_CREDIT_CHECK_ORDER_PVT. In this procedure, the call to the API, the credit classification is passed as null. As a result the credit application cannot be processed further. Is any Oracle Patch required to fix this issue. Morevover we cannot update the table with credit classification, since the credit application is in submitted state.
               AR_CMGT_CREDIT_REQUEST_API.Create_credit_request
               ( p_api_version           => 1.0
               , p_init_msg_list         => FND_API.G_FALSE
               , p_commit                => FND_API.G_FALSE
               , p_validation_level      => FND_API.G_VALID_LEVEL_FULL
               , x_return_status         => x_return_status
               , x_msg_count             => l_msg_count
               , x_msg_data              => l_msg_data
               , p_application_number    => NULL
               , p_application_date      => SYSDATE
               , p_requestor_type        => NULL
               , p_requestor_id          => fnd_global.employee_id
               , p_review_type           => 'ORDER_HOLD'
               , p_credit_classification => NULL
               , p_requested_amount      => l_total_exposure
               , p_requested_currency    => l_limit_curr_code
               , p_trx_amount            => g_order
               , p_trx_currency          => p_header_rec.transactional_curr_code
               , p_credit_type           => 'TRADE'
               , p_term_length           => NULL  --the unit is no of months
               , p_credit_check_rule_id  =>
                       p_credit_check_rule_rec.credit_check_rule_id
               , p_credit_request_status => 'SUBMIT'
               , p_party_id              => l_review_party_id --bug 5907331
               , p_cust_account_id       => l_customer_id
               , p_cust_acct_site_id     => NULL
               , p_site_use_id           => l_site_use_id
               , p_contact_party_id      => NULL --party_id of the pseudo party
               , p_notes                 => NULL  --contact relationship.
               , p_source_org_id         => l_source_org_id
               , p_source_user_id        => l_source_user_id
               , p_source_resp_id        => l_source_resp_id
               , p_source_appln_id       => l_source_appln_id
               , p_source_security_group_id => l_source_security_group_id
               , p_source_name           => 'OM'
               , p_source_column1        => p_header_rec.header_id
               , p_source_column2        => p_header_rec.order_number
               , p_source_column3        => 'ORDER'
               , p_credit_request_id     => l_request_id
    Please let me know the solution.
    Warm Regards,
    Vivek.

    Hello,
         MDM Version is 5.5.65.86
             Portal
             sap.com/SAP-JEECOR  7.00 SP18 (1000.7.00.18.0.20081123155626)  20091203155047 
             sap.com/SAP-JEE  7.00 SP18 (1000.7.00.18.0.20081123155510)  20091203154825 
             sap.com  MDM_JAVA_API  5.50 SP6 (1000.5.50.6.5.20100120101105)  SAP AG  SAP AG  20100204091131 
             sap.com  MDM_WEB_SERVICES  550 SP6 (1000.550.0.6.5.20100117165943)  SAP AG  MAIN_MDM55VA_C  20100204091208 
    this problem happened after our P system upgrade from 5.5.65.76 to 5.5.65.86,sometime when our MDM upgrade,SAP supply correspond WEBSERVICE jar, but this time ,SAP does not supply the correspond WEBSERVICE JAR file.we used WEBSERVICE JAR is the one that correspond with 5.5.65.76 may be this is the isuue causation

  • Decode null with function call

    Hi
    Is it possible to use decode in select for the below scenario, if so what is the correct syntax
    IF function one returns null I want to call display the value from function 2 in decode statement.
    Regards
    anna

    Hi, Anna,
    I would use COALESCE for that:
    COALESCE (a1, a2, a3, ...)returns the first of its arguments (there can be as few as 2, and probably at least 100) that is not NULL.
    If you need help, post some sample data (CREATE TABLE and INSERT statements), function code, and the results that you want from that data.

  • Null reference method call behaving oddly

    Hi all, and a very happy new year!!
    My question concerns the null reference; simply, why does the following code chooses to call any other method than the Object version (try it out). No matter what type i choose to replace the current String version with... I have not paid much thought to this, but i would have guessed the null reference calls the Object version in such a situation.
    If i leave only the Object method and comment out all others, the code compiles fine and calls the Object version at runtime - but in case there are sub class versions, those will be called. WHY?
    (im running jre 1.4.1).
    The code:
    public class NullTest {
         public void method(Object o) {
              System.out.println("Object Version");
         public void method(String s) {
              System.out.println("String Version");
         public static void main(String args[]) {
    NullTest nullTest = new NullTest();
              nullTest.method(null);
    }

    schapel, the question related specifically to
    null, in a context where no runtime type can be
    inferred. It wasn't about overloading in general.Yes, I understand that. But here is the rule from the JLS:
    "If more than one method declaration is both accessible and applicable to a method invocation, it is necessary to choose one to provide the descriptor for the run-time method dispatch. The Java programming language uses the rule that the most specific method is chosen."
    Note that it does not refer specifically to a null argument.
    The question is "why is the most specific method called?" The reason is that there are only a few possibilities for this rule:
    1. The least specific method should be called. In this case, overloaded methods with more specific types could not be called.
    2. If there is more than one method, it is a compile time error. Again, this would cause overloading to be useless.
    3. The most specific method is called. It is only with this rule that overloading works. That's why Java uses this rule.

  • JCA Adapter matchManagedConnection and BPEL

    We have a implementation of the J2CA Adapter to integrate an Oracle EIS application with other Oracle Applications. From the perspective of our JCA Adapter (to the EIS), information arrives via BPEL code (which in turn gets it from other Oracle Applications). The information from BPEL signifies what activity to do etc.
    We have implemented the interface ManagedConnectionFactory.matchManagedConnections, within which we are supposed return a matching ManagedConnection with respect to the incoming Connection request. However, I am unaware on what basis this matching should be done . The ManagedConnection implementation is directly associated with a connection to the EIS. Thus, for activities such as below, the same ManagedConnection from the matchManagedConnections should be returned for all the operations until a commit is invoked. How do I do it? Based on what criteria?
    BPEL -> open transaction -> JCA -> open transaction -> EIS
    BPEL -> activity (say insert operation) -> JCA -> insert operation -> EIS
    BPEL -> commit transaction -> JCA -> commit transaction -> EIS
    Is there some BPEL partnerLink property which can be used to determine that for the current Connection request a particular ManagedConnection has to be returned? ConnectionRequestInfo contains only username/password and hence is useless in this scenario.
    The App Server is OC4J 10.1.3.1.
    Thanks,
    PC
    Edited by: user770775 on May 3, 2010 4:02 AM

    Hi,
    Goto the URL:
    http://abhishek-soablog.blogspot.com
    See the entry of September 2007. It will be helpful for all the begineers.
    Cheers,
    Abhi...

  • How to call Standard Iviews in Webdynpro application?

    How to call STD iviews  in the wwbdynpro application.
    can any of friends give the code

    Use this snippet to call standard iviews from your webdynpro code :
    //use LinktoAction UI element
    onActionClick (com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent)
    WDPortalNavigation.navigateAbsolute("ROLES://portal_content/folders/X.Iview", WDPortalNavigationMode.SHOW_INPLACE, (String)null, (String)null, WDPortalNavigationHistoryMode.NO_DUPLICATIONS, "Called iView Name", (String)null, (String)null);
    Hope this helps.
    Rgds
    Prabhakar

  • RFC Call in Message Mapping

    Hi there
    I am trying to do a table lookup from XI in my message mapping by calling an remote RFC. The return values must return ALL the value for a specific column. The code I have here returns a blank value. Can someone see what my problem may be?
    My variables for my UDF is:
    public String UDF_RFC(String DBTABLE,String MATNR,String FIELDS,String businessSystem,String communicationChannel,Container container)
    And my Code:
    "My code appears to mess up my message structure, I will attach it in a responce..
    Thanks,
    Jan
    Edited by: Jan de Lange on Sep 16, 2009 11:09 AM
    Edited by: Jan de Lange on Sep 16, 2009 11:09 AM

    // declare parameters
    String returnValue = "";
    String rfcXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:ZINT_XI_GET_SITES xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><LT_SITES><item><WERKS></WERKS></item></LT_SITES></ns0:ZINT_XI_GET_SITES>";
    AbstractTrace trace = container.getTrace();
    RfcAccessor accessor = null;
    ByteArrayOutputStream out = null;
    try
    // 1. Determine a communication channel (Business system + Communication channel)
    Channel channel = LookupService.getChannel(businessSystem,communicationChannel);
    // 2. Get a RFC accessor for the channel.
    accessor = LookupService.getRfcAccessor(channel);
    // 3. Create an XML input stream that represents the RFC request message.
    InputStream inputStream = new ByteArrayInputStream(rfcXML.getBytes());
    // 4. Create the XML Payload
    XmlPayload payload = LookupService.getXmlPayload(inputStream);
    // 5. Execute the lookup.
    Payload result = null;
    result = accessor.call(payload);
    InputStream in = result.getContent();
    // 6. Create a DOM structure from the input XML
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(in);
    NodeList      nodelist = document.getElementsByTagName("*");
    Node          node;
    Element       element;
    NamedNodeMap  nnm = null;
    String attrname;
    String attrval;
    int    i, len;
    len = nodelist.getLength();
    for (int j=0; j < len; j++) {
                element = (Element)nodelist.item(j);
                System.out.println(element.getTagName() + ":");
                nnm = element.getAttributes();
            if (nnm != null) {
                for (i=0; i<nnm.getLength(); i++) {
                    node = nnm.item(i);
                    attrname = node.getNodeName();
                    attrval  = node.getNodeValue();
                    returnValue += attrname + " = " + attrval + "##";
    // 7. To free resources, close the accessor..
    if (accessor!=null) {
    try {
    accessor.close();
    } catch (LookupException e) {
    trace.addWarning("Error while closing accessor " + e.getMessage() );
    } catch (Exception e) {
    trace.addWarning("Error" + e);
    // 8. return a single id value to the message mapping
    return returnValue;

  • Getting nuts with null atributes problem

    Hello everybody,
    I have this problem:
    My project is working fine except one JSP-Backing bean pair that is driving me crazy, When I load the JSP through a tree2 menu, the page loads ok, I have some selectOneMenu components, that are loaded in the constructor of my backing bean using some Business Delegate Methods, in the JSP I also have some InputText components, when I click the button that takes all values to build a BO object that I have to pass to ht Business Delegate, everything into the bean is null.
    I have tried to read the value of the components using the two normal ways:
    1. Calling the name of the variable directly: for example:
    String nameValue = strNameSelected();2. Calling its get method:
    String nameValue = getStrNameSelected();None of the work, when I print them in console all values are null.
    All calls are into the same bean, nonetheless, everything gets returned as null, so I tried first to acquire the bean from the session, to read its values, like this:
    MyBackingBean myBean =
                   (MyBackingBean ) sesion.getAttribute("MyBackingBean ");
          bearing in mind that MyBackingBean is the name in the faces-config.xml.
    However, this brings the same results. Null elements into the bean.
    The declaration of the bean in the faces-config.xml is this:
    <managed-bean>
              <managed-bean-name>MyBackingBean </managed-bean-name>
              <managed-bean-class>com.mycompany.bean.MyBackingBean </managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>What I cannot understand is Why the selectOneMenus are getting loaded with the right values in the constructor, but at the time I call the value of the elements they are null :-(
    Have anyone faced a problem like this?? I'm in a very big hurry, hope someone can help me :-)
    Thanks a lot

    Hello Pringi,
    I have found the source of the problem, I had a immediate="true" attribute in the button, so this was generating the problem.
    Thanks a lot for your interest.

  • Calling Stored Procedure from JDeveloper

    Hi All,
    Is it possible to call a Java or PL/SQL Stored Procedure from JDeveloper ?
    can someone give me some code examples?
    HAPPY NEW MILLENIUM
    Rj

    One way, using jdbc against a stored function ( you need to set up the connection... search earlier postings ):
    try
    Statement call= OpenDBConnections.myJdbcConnection.createStatement();
    ResultSet rset=call.executeQuery("SELECT getCustomerName('"+
    tmpCustomerNumber+
    "') AS CUST_NAME FROM DUAL");
    rset.next();
    customerName_tf.setText(rset.getString("CUST_NAME"));
    rset.close();
    call.close();
    catch (SQLException esql)
    System.out.println(esql.toString());
    For a stored procedure returning a resultset:
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    try
    CallableStatement call =
    OpenDBConnections.myJdbcConnection.prepareCall
    ("{? = call CRR_GET_PART_HISTORY(?)}");
    call.registerOutParameter(1,OracleTypes.CURSOR);
    call.setString(2,partNumberHist_tf.getText().toString());
    call.execute();
    OracleResultSet rset=(OracleResultSet)call.getObject(1);
    /* use caching result set cuz it is non scrollable stored proc result */
    model = new CachingResultSetTableModel(rset);
    history_tbl = new JTable(model);
    historyStatus_tf.setText(history_tbl.getRowCount()+" matching records found.");
    jScrollPane1.getViewport().add(history_tbl, null);
    rset.close();
    call.close();
    catch (SQLException esql)
    System.out.println(esql.toString());
    On the stored procedure side one sets up a ref cursor... you'll need to define a
    type sqlcur is REF cursor;
    end;
    Again... do a search on this group and you'll find a wealth of info ( and gotchyas ).

  • Calling an Oracle stored procedure and retrieving result from OUT parameter

    Hello,
    I have a stored procedure that returns a string in an OUT parameter after receiving 6 IN parameters. I have tested the procedure in PL/SQL and it's producing the right output there. The problem is when I call the stored procedure from my Java method. I then get an error message telling me that I have the wrong number or types of arguments in my procedure call. I have checked that the method receives and sends the correct data in the correct order and I'm not sure what else the error message can relate to...?
    The exception is called on my second try statement but I haven't been able to find out what I have done wrong there. Does anyone have any suggestions? Thanks.
    the error message
    java.sql.SQLException: ORA-06550: line 1, column 13: PLS-00306: wrong number or types of arguments in call to 'P_SET_GIVEN_ANSWER' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    the procedure
    CREATE OR REPLACE PROCEDURE p_set_given_answer(
    strfeedback OUT VARCHAR2,
    intpi_id IN INTEGER,
    intquestion_id IN INTEGER,
    intgivenanswer IN INTEGER,
    strgivenprefix IN VARCHAR2,
    strgivenunit IN VARCHAR2,
    strgu_id IN VARCHAR2) AS
    -- some declarations
    BEGIN
    -- some processing and then returns the string below indicating the outcome
    strfeedback = 'result';
    END
    the java method (the class is called dbUtil and the database connection is created in the method called getDbConnection() )
    public void setGivenAnswer(int intPi_id, int intQuestion_id, int intGivenAnswer, String strGu_id, String strGivenPrefix, String strGivenUnit) {
    java.sql.Connection con = null;
    String query = "{call ? := p_set_given_answer(?,?,?,?,?,?)}";
    try {
    con = dbUtil.getDbConnection();
    } catch(Exception e) {
    dbConnectionExceptionMessage = "error 1:"+e.toString();
    try{
    CallableStatement stmt = con.prepareCall(query);
    // register the type of the out param - an Oracle specific type
    stmt.registerOutParameter(1, OracleTypes.VARCHAR);
    // set the in params
    stmt.setInt(2, intPi_id);
    stmt.setInt(3, intQuestion_id);
    stmt.setInt(4, intGivenAnswer);
    stmt.setString(5, strGivenPrefix);
    stmt.setString(6, strGivenUnit);
    stmt.setString(7, strGu_id);
    // execute the stored procedure
    stmt.execute();
    // retrieve the results
    strFeedback = stmt.getString(1);
    } catch (java.sql.SQLException e) {
    dbConnectionExceptionMessage = "error 2:"+e.toString();
    try {
    con.close();
    } catch (java.sql.SQLException e) {
    dbConnectionExceptionMessage = "error 3:"+e.toString();
    ----------------------------------------

    Looks like you are declaring a procedure, but you are calling it like a function. A procedure has no return value, it has only parameters: "{call p_set_given_answer(?,?,?,?,?,?,?)}"

  • How to insert null in C++ Class library

    I am using oo4o Class library. I am inserting arrays into the database
    This is my code (it is simplified):
    // C++ Code
    OStartup();
    oRes = m_o_Session.Open(); // m_o_Session is OSession // oRes is oresult
    oRes = m_o_db.Open(m_o_Session,sSource,sUser,sPassword); // m_o_db is ODatabase
    oRes = m_o_db.BeginTrans();
    // the insert proccess
    // Add Params
    OParameterCollection oParamCol = oDB.GetParameters();
    OParamArray o_NUM_INDEX_Ary = oParamCol.AddTable("xi_lv_NUM_INDEX",OPARAMETER_INVAR,OTYPE_NUMBER,10);
    OParamArray o_TEXT_Ary = oParamCol.AddTable("xi_sv_TEXT",OPARAMETER_INVAR,OTYPE_VARCHAR2,10,250);
    OParamArray o_NUMBER_OPT_Ary = oParamCol.AddTable("xi_dv_NUMBER_OPT",OPARAMETER_INVAR,OTYPE_NUMBER,10);
    for(int i =0;i<10;i++){
    o_NUM_INDEX_Ary.SetValue(i,i);
    o_TEXT_Ary.SetValue("asdasd",i);
    o_NUMBER_OPT_Ary.SetValue(??????,i);
    oRes = oDB.ExecuteSQL("INSERT INTO GEN_TABLE_TEST_T (NUM_INDEX,TEXT,NUMBER_OPT) VALUES (:xi_lv_NUM_INDEX,:xi_sv_TEXT,:xi_dv_NUMBER_OPT)");
    oParamCol.Remove("xi_lv_NUM_INDEX");
    oParamCol.Remove("xi_sv_TEXT");
    oParamCol.Remove("xi_dv_NUMBER_OPT");
    oRes = m_o_db.CommitTrans();
    oRes = m_o_db.Close();
    m_o_Session.Close();
    OShutdown();
    my question is where I marked ?????? I want to insert null to a numeric field
    I tried to put NULL instead of ?????? - does not work
    I tried to put OValue initialized with null instead of ?????? - does not work
    and I need to send him in the insert Sql because sometimes it does not null and i have to give him value.
    thanks is advance
    Yoav

    Just create an empty OValue object:
    OValue nullv; // construct null value
    then call the appropriate SetValue method...
    xxx.SetValue(nullv);
    Should do it.

  • JNI call seem to be very slow

    Hello,
    I have an optimized JPEG decoder written in C++, I have a JNI bridge to that codebase with this method:
    Java-side:
    public static native byte[] readJPEG(String name);C++ side:
    JNIEXPORT const jbyteArray JNICALL Java_IPPJPEGDecoder_readJPEG(JNIEnv *, jclass, jstring);I have this call in Java layer:
    long start = System.currentTimeMillis();
    byte[] data = IPPJPEGDecoder.readJPEG("C:\\D-102_red_ink_1.JPG");
    long end = System.currentTimeMillis();
    System.out.println("total time = " + (end - start));This is my method in C++ (rough/ugly code, don't judge me :) )
    JNIEXPORT const jbyteArray JNICALL Java_IPPJPEGDecoder_readJPEG (JNIEnv * env, jclass jobj, jstring jpeg_filename)
        //cout << "INVOKED IPPJPEGDecoder.readJPEG() SUCCESSFULL" << endl;
        //cout << "Started"<<endl;
        CIppImage m_image;
        CIppImage grayscale_image;
        CIppImage monochrome_image;
        CTimer timer;
        timer.Start();
        CStdFileInput in;
        const IppLibraryVersion* libver = ippGetLibVersion();
        cout << "LibraryVersion = (" << libver->Name <<": " << libver->Version << ")"<<endl;
        UIC::BaseStream::TStatus status;
        jboolean iscopy;
        const char * filename = env->GetStringUTFChars(jpeg_filename,&iscopy);
        status = in.Open(filename);
        GetImageFromJPEGJNI(in, m_image, timer);
        cout<<"m_image: (Precision: " << m_image.Precision() << ", NumChannels: " <<m_image.NChannels()<<", Width: " << m_image.Width() << ", Height: " << m_image.Height()<< ", Color: " << m_image.Color() <<", step: " << m_image.Step()<<endl;
        timer.Start();
        cout << "data array size of image : " <<(m_image.Step()*m_image.Height())<<endl;
        jbyteArray jb = env->NewByteArray(m_image.Step()*m_image.Height());
        env->SetByteArrayRegion(jb,0, m_image.Step()*m_image.Height(),(const jbyte*)m_image.DataPtr());
        timer.Stop();
        double mytime = timer.GetTime();
        cout << "JNI occurred in " << mytime << " ms"<<endl;
        return jb;
        //return NULL;
    }When I call this code, the C++ codeblock reports as running in 92.7793 ms
    My java code reports back: 572 ms
    is the Call to the JNI method THAT INSANELY slow !?!?! I MUST be doing something wrong... this is in Windows XP and I'm linking against my own dll that I compiled in Microsoft Visual C++ 2008.
    The jbyteArray that I'm passing back has a length of 33583500
    ... maybe it's the conversion from jbyteArray to Java's byte[] that is causing all the overhead.... are there any ways around that?
    Thanks!!
    Alessandro Ferrucci

    alessandro_ferrucci wrote:
    I need to process about *500 MILLION* images...this speed difference matters So at 1 second per image it will take 16 years. Or with 100 machines 2 months.
    JNI Code completes in 337 ms (still about 200 ms faster than ImageIO's libjpeg on my machine),So now you are down to 5 years. Or 20 days with 100 machines.
    Course all of the above is 24x7 dedicated processing.
    If it was me I would look into changing the requirements and the architecture.
    Probably cost effective to hire several senior level programmers with experience in image processing and/or performance optimization as well.

  • Handling NULL in Oracle Function

    I try to handle NULL with IS NULL in side the Function. But I some how can't do it. Control always goes to NO_DATA_FOUND Exception block.
    In BEGIN block, if I try to handle with IS NULL condition but it doesn't work. But if I use DBMS_OUTPUT.PUTLINE and display the variable with NVL, it tells me it is NULL.
    My code is like;
    <code>
    FUNCTION F_GetProductKey (p_CompanyCod varchar2, p_ProductCod varchar2) return number;
    as
    vi_ProductKey Number;
    BEGIN
    DBMS_OUTPUT.PUT_LINE( NVL(p_ProductCod,'abc') <----- This displays 'abc'
    IF p_ProductCod IS NULL THEN
    SELECT PRODUCT_KEY in vi_ProductKey from DIM_PRODUCT WHERE Product_Cod=-2;
    ELSE <---- Control Always Goes to ELSE even p_ProductCod is NULL & then it goes to NO_DATA_FOUND Exception
    SELECT PRODUCT_KEY in vi_ProductKey from DIM_PRODUCT WHERE Product_Cod=p_ProductCod AND COMPANY_COD = p_CompanyCod ;
    END IF;
    return vi_Product_Key;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
         return -20060;
    WHEN OTHERS THEN
    return -20001;
    END;
    </code>
    I've a hard coded value in table for Product_Cod=-2, so I should never get No_Data_Found exception if ProductCod is NULL. I checked, for CompanyCod and it is NOT NULL when I call function.
    I Googled to look at what I'm doing wrong. I find that NULL values can be handled by ISNULL but some how it doesn't work in my case.
    Is there any other way to handle NULL inside function??

    I've a hard coded value in table for Product_Cod=-2, so I should
    never get No_Data_Found exception if ProductCod is NULL.Are you sure? It seems to me the behaviour you describe could equally well be explained by the control going down the IF ... IS NULL branch and then not finding the PRODUCT_COD in question.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/
    P.S. Having read your subsequent message, specifically this
    Product_cod is varchar2. It is actually comparing to
    'UNK' not -2 in side the code.I am even more certain that the problem lies in your data. Larry Ellison did not become a multi-billionnaire on the basis of code which behaved in an unpredictable fashion.
    Message was edited by:
    APC

  • Descriptor query manager and custom PL/SQL call for the data update

    hi all,
    in the application, I'm currently working on, the operations for the data INSERT/UPDATE /DELETE are allowed only by means of PL/SQL function. Using the descriptor's query manager I'm trying to modify default behavior of TopLink and execute PL/SQL when there is a request to modify the data.
    DescriptorQueryManager entityQueryManager = session.getClassDescriptor(MyEntity.class).getQueryManager();
    StoredFunctionCall call = new StoredFunctionCall();
    call.setUsesBinding(true);
    call.setProcedureName("merge_record");
    call.setResult("id", Integer.class);
    call.addNamedArgument("cbic_id", "id"); // MyEntity.getId() – works!
    call.addNamedArgument("publication_flag", "publicationFlag"); // MyEntity.getPublicationFlag () – works!
    call.addNamedArgument("routing_id", "routing"); // MyEntity.getRouring() – works!
    call.addNamedArgument("issue_id", "issue"); // MyEntity.getIssue() – works!
    call.addNamedArgument("country_id", "country"); // MyEntity.getCountry() – works!
    entityQueryManager.setInsertCall(call);
    entityQueryManager.setUpdateCall(call);
    entityQueryManager.setDeleteCall(call);
    the problem:
    when I call: MyEntity savedObject = (MyEntity) UnitOfWork.deepMergeClone(entity);
    the binding doesn’t happen and I see following logs:
    [TopLink Finest]: 2008.02.01 02:51:41.534--UnitOfWork(22937783)--Thread(Thread[AWT-EventQueue-0,6,main])--Merge clone xxx.Entity[id=2000]
    [TopLink Warning]: 2008.02.01 02:51:41.550--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: id null will be substituted. (There is no English translation for this message.)
    [TopLink Warning]: 2008.02.01 02:51:41.550--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: publicationFlag null will be substituted. (There is no English translation for this message.)
    [TopLink Warning]: 2008.02.01 02:51:41.565--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: routing null will be substituted. (There is no English translation for this message.)
    [TopLink Warning]: 2008.02.01 02:51:41.565--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: issue null will be substituted. (There is no English translation for this message.)
    [TopLink Warning]: 2008.02.01 02:51:41.565--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: country null will be substituted. (There is no English translation for this message.)
    [TopLink Fine]: 2008.02.01 02:51:41.565--ClientSession(8454539)--Connection(6233000)--Thread(Thread[AWT-EventQueue-0,6,main])--BEGIN ? := merge_record(cbic_id=>?, publication_flag=>?, routing=>?, issue=>?, country=>?); END;
    bind => [=> id, null, null, null, null, null] – WHY?
    Calling straight forward the same PL/SQL block using:
    DataModifyQuery updateQuery = new DataModifyQuery();
    updateQuery.setCall(call);
    updateQuery.shouldBindAllParameters();
    and passing parameters as Vector works very well.
    Could you please help me to fix the binding problem when I’m using the PL/SQL with Query Manager?
    regards,

    Hello,
    This is fairly common. Since the database is case insensitive (mostly) field names passed in don't really matter much. Unfortunately, java string comparisons are case sensitive, so if you db column for the getId() property is defined as uppercase "ID" it will not match to the lower case "id" defined in the
    call.addNamedArgument("cbic_id", "id");
    This will cause TopLink to get null when it looks for the "id" field in the row it builds from your MyEntity instance.
    Matching the case exactly will resolve the issue.
    Best Regards,
    Chris

  • Calling PL\SQL procedures

    What's the best way to invoke a PL\SQL procedure using Java?
    I am hoping to use the values passed from the JSP into the database for computations but don't know how to call the procedure after the commit.
    Any ideas?
    Thanks a lot!

    Example follows for a PL/SQL proc call from a Java application that returns a result set and displays it in a scrolling pane. Hope it helps you:
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    try
    CallableStatement call =
    OpenDBConnections.myJdbcConnection.prepareCall
    ("{? = call MY_PLSQL_PROC(?)}");
    call.registerOutParameter(1,OracleTypes.CURSOR);
    call.setString(2,partNumber_tf.getText().toString());
    call.execute();
    OracleResultSet rset=(OracleResultSet)call.getObject(1);
    /* use caching result set cuz it is non scrollable stored proc result */
    model = new CachingResultSetTableModel(rset);
    result_tbl = new JTable(model);
    status_tf.setText(result_tbl.getRowCount()+" matching Rows found.");
    jScrollPane1.getViewport().add(result_tbl, null);
    rset.close();
    call.close();
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    catch (SQLException esql)
    System.out.println(esql.toString());
    }

Maybe you are looking for

  • Eject Button Inactivated Disc Won't Eject

    I just bought my macbook pro new and suddenly (since I updated to 10.6.6, coincidence?) my eject button will not work, nor does it made any effort to eject the disc that I put inside. I've tried pushing eject (no symbol or noise), I've tried using te

  • Signed XML in SOAP Adapter

    Hello Experts, I have a scenario with receiver SOAP adapter, I have used the security profile in the channel and receiver agreement i have selected sign and all rudimentary requirements.. But im unable to see the signed payload in the CC monitoring..

  • Is it possible to define multiple Initial Extract Date' for Different modules ? INITIAL_EXTRACT_DATE

    HI We are configuring BI Apps 11.1.1.7.1 For HRMS and Financials.  HRMS data should extract from  '2010-01-01' and Financials Data should extract from '2012-01-01' is it possible? Source system: EBS 12.1.3 OBIEE: 11.1.1.7 BI APPS: 11.1.1.7.1 ODI: 11.

  • Regarding A2A  and B2B applications

    hai can any one give the real time example on A2A and B2B  scenarios its a frquently asked question in interviews

  • Where can I find the right doc for SunStudio For Linux ?

    I can find the docs for SunStudio here, http://docs.sun.com/app/docs/doc/819-5265/6n7c29ck9?a=view but it seems that it doesn't right on linux platform. #include <stdio.h> int main(void) #if defined(sun)         printf("sun defined \n"); #else