Error when calling stored procedure of backing bean

I use Jdeveloper 11.1.1.6 and tries to use the following URL to execute a SP of a bean of support: http://ramannanda.blogspot.com/2011/11/optimized-update-insert-adf.html

The reason why I'm interested in this is currently I coded my support bean to perform insertions and deletions by the use of my objects in view. I am the scene up to a combined 5-10 K, insertions and deletions and performance is rather slow. If there is a way to adjust the display objects as well as the validation is much faster, it is the preferred method. If this cannot be done then I would understand the approach identified in the URL.

I've highlighted a section of code below fails when you use the approach of the URL. It-error with the following exception: javax.el.ELException: oracle.jbo.JboException: java.sql.SQLException: internal error: incompatible catalog view


You have thoughts about what could cause this exception.





create or replace
TYP_TEST_R type is object
(
Test_Id Number (5.0).
Test_Num Number (7.0)
);


create or replace
type TYP_TEST_TB as the TYP_TEST_R table;



{} private void myMethod (MyTableVORowImpl pCurrentRow)
int i = 0;
DCIteratorBinding = lDciter
(DCIteratorBinding) getBindings () .get ("MyTable1Iterator");
MyAppModuleAMImpl = lMyAppModuleAMImpl
(MyAppModuleAMImpl) lDciter.getViewObject () .getApplicationModule ();
Connection = lConnection
lMyAppModuleAMImpl.getDBTransaction () .createStatement (1) .getConnection ();
StructDescriptor lTblRecordStructType =
StructDescriptor.createDescriptor ("DBADMIN. TYP_TEST_R,"
lConnection);

... < additional logic here >...


Object [] lArray = Object [lSortedDifferences.size (new)];
all in (...) {
Number lNumber =...
Number of lDifferentStore = (Number) lDifferentIterator.next ();


STRUCT lTempStruct =+ _
new STRUCT (lTblRecordStructType, lConnection,+ _)
* new Object() {pCurrentRow.getTestId (), * + _}
({ lDifferentStore}) ; +_
lArray [i] = lTempStruct;
i = i + 1;
}

create table structure descriptor
ArrayDescriptor = lTableDesc
ArrayDescriptor.createDescriptor ("DBADMIN. TYP_TEST_TB,"
lConnection);
create a type of table with the structure definition
LTableArray = ARRAY
New ARRAY (lTableDesc, lConnection, lArray);
String lCallableProcedureStatement =
"start DBADMIN. SP_TEST(?,?); end; « ;
OracleCallableStatement lOracleCallableStatement = null;
lOracleCallableStatement =
(OracleCallableStatement) lMyAppModuleAMImpl.getDBTransaction (.createCallableStatement (lCallableProcedureStatement),
(0);
lOracleCallableStatement.setARRAY (1, lTableArray);
lOracleCallableStatement.setString (2,
(String) ADFUtil.evaluateEL("#{sessionScope['UserName']}"));
lOracleCallableStatement.executeUpdate ();
}

Hello

the user that executes the statement has the correct grant to the user-defined type?

concerning
Peter

Tags: Java

Similar Questions

  • NullPointerException when calling stored procedure

    I have the stored procedure

    create or replace PROCEDURE GREETING_PROC

    (

    TEXT_PARAM IN VARCHAR2

    MSG_TEXT VARCHAR2 OUT

    ) AS

    BEGIN

    MSG_TEXT: = "Hello" | TEXT_PARAM;

    END;

    My stored procedure call method

    public class UserBean {}

    public UserBean() {}

    Super();

    }

    Public Shared Sub main (String [] args) {}

    UserBean userBean = new UserBean();

    userBean.callP ();

    userBean.callStoreProcedure ();

    }

    public void callStoreProcedure() {}

    CallableStatement st = null;

    SysUser SysUserEOImpl = new SysUserEOImpl();

    try {}

    String sql = "BEGIN GREETING_PROC (: TEXT_PARAM,: MSG_TEXT); END; « ;

    St = sysUser.getDBTransaction () .createCallableStatement (sql, sysUser.getDBTransaction (). DEFAULT VALUE);

    st.setObject ("TEXT_PARAM", "Scoot");

    st.registerOutParameter ("MSG_TEXT", Types.VARCHAR);

    St.Execute ();

    System.out.println ((String) St.GetObject ("MSG_TEXT"));

    } catch (SQLException e) {}

    throw new Aexception.getLocalizedMessage (e);

    }

    }

    then I got an exception:

    Exception in thread "main" java.lang.NullPointerException

    at cic.opsi.model.bean.UserBean.callStoreProcedure(UserBean.java:35)

    at cic.opsi.model.bean.UserBean.main(UserBean.java:27)

    Hello

    What statemet is UserBean.java:35)?

    Second, create a new SysUserEOImpl()!

    If you want to call stored proc, put the java code calling stored proc in ViewRowImpl/ViewObjectImpl/ApplicationModuleImpl and export this code in the customer interface. Then put this method in the pageDef as a call him as an OperationBinding

    Zeeshan Baig blog: the PL/SQL procedure call and function in the Oracle ADF application

    Extending the functionality of the components Business

    ADF/OFA for Oracle Techies: ADF call stored procedure with Out parameters

    Latest Oracle technology: call Store procedures for Oracle ADF Application

  • Error when the stored procedure returns a cursor in c pro


    Hello

    I tried to make things work, explained to the
    [2537153 m]

    He runs a stored procedure from pro c which returns a cursor.
    But when I compllie to c pro I get following error. My name of the procedure's TEST.
    If I change the output to an int value parameter. It compiles okay.



    PLS-S-00306, wrong number or types of arguments in the call to 'TEST '.
    Error on line 34, column 5 in file E:\C\Test\tt.pc
    TEST(:test_cursor);
    +.... 1 +.
    PLS-S-00000, ignored statement
    A semantic error on line 33, column 1, folder E:\C\Test\tt.pc:
    BEGIN
    + 1 +
    PCC-S-02346, PL/SQL found semantic errors

    Can make a point about what could be the error?
    I work from oracle 8i client. that connects to oracle 9.0.1.
    Operating system is win 2000 sp4

    Oh yes - differs from the code snippet I posted your with the declaration of the host cursor variable. A difference in the case. Is how important it?

    ( it's been almost 10 years since I've coded last in Pro * C, so be careful with these questions! ) ;-) )

  • Error when calling a procedure using an external table with c#.

    Hello

    I'm developing an application scheduler with Visual Studio 2010 (c#) to start my PL/SQL procedures.

    Everything works fine with each procedure, but one who reads the contents of an external table.

    Strange thing is when I start the same procedure with Toad, I have no problem, but when I run with my c# code:

    OracleCommand cmdMET = new OracleCommand();

    cmdMET.CommandText = 'STG_AE. M_MET_S_EXT_DEFECT ';

    cmdMET.CommandType = CommandType.StoredProcedure;

    con = cmdMET.Connection;

    OracleParameter retvalMET = new OracleParameter ("value", OracleDbType.Varchar2, 50);

    retvalMET.Direction = ParameterDirection.ReturnValue;

    cmdMET.Parameters.Add (retvalMET);

    cmdMET.ExecuteNonQuery ();

    I got this error:

    ORA-29913: error in executing ODCIEXTTABLEFETCH legend

    ORA-01722: invalid number

    ORA-06512: at "STG_AE. M_MET_S_EXT_DEFECT', line 8

    ORA-06512: at "STG_AE. MET_SRC', line 10

    ORA-06512: at "STG_AE. PUTS", line 14

    ORA-06512: at line 1

    I can't understand why it works when I run it with Toad and why I get this error when launching of it with c#... Any advice would be great!

    Thank you!

    I can't understand why it works when I run it with Toad and why I get this error when launching of it with c#... Any advice would be great!

    The error led to think that a string to number conversion fails all by accessing the external table.

    What is the format of numeric fields in the external file?

    I'm guessing that your session NLS_NUMERIC_CHARACTERS setting is defined differently whether you're in your application c# or toad.

    Could check you on both?

  • Error when calling a method AM of Bean managed

    Hi friends,

    JDev's Studio Edition Version 11.1.2.4.0

    I have a page (HomePG) that has a read-only table. Select a field in the table and you enter a value for the inputText and then clicking on a button, the selected employee's salary should be replaced by the value entered in the inputText field.

    I am trying to call a method of the managed bean AM and I get an error while doing this. I created a link to the method in the page where the call is made.

    Here is the code of the AOS

    ' Public Sub hikeSelectedRow (Key key, BigDecimal val) {}

    ViewObjectImpl emp = getEMPVO1();

    RowSetIterator empVO = emp.createRowSetIterator ("Test");

    System.out.println ("in selected Update");

    System.out.println ("in selected, Update key:" + key);

    Row [] selectedEmpArr;

    selectedEmpArr = empVO.findByKey (key, 1); -> Error comes here

    System.out.println ("in selected, Update key:" + key.toString ());

    EMPVORowImpl selectedEmp = (EMPVORowImpl) selectedEmpArr [0];

    selectedEmp.setSal (selectedEmp.getSal () .add (val));

    System.out.println ("added, made Bravo");

    getTransaction () .commit ();

    }

    The line is selected in the Managed bean and is also selected. However during appraisal findByKey get the performance I get the below error. Can someone please.

    The error I get is

    < ActionListenerImpl > < processAction > java.lang.NumberFormatException: for input string: "[oracle.jbo.Key [7566]].

    javax.faces.el.EvaluationException: java.lang.NumberFormatException: for input string: "[oracle.jbo.Key [7566]].

    at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)

    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)

    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:130)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)

    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)

    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:130)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)

    KeyVal key = new key (new Object() {Integer.parseInt (((List) tableIterator.next ()) m:System.NET.SocketAddress.ToString ())});

    So, what will return: (tableIterator.next ()) m:System.NET.SocketAddress.ToString () (list)?

    I suppose this relates a strange string?

    Check out this blog for a correct use of the RowKeySet (and is also described in a easier way to get the current line in the case of single selection): ADF:TABLE - Get selected or lines. John Brunswick

    Dario

  • Calling stored procedure - re-edited NullPointerException

    Hi all

    I am re-editing that my first attempt was quite low.

    I want to create a Java application that communicates with an Oracle XE database edition to:

    Class.forName ("oracle.jdbc.driver.OracleDriver");
    JOptionPane.showMessageDialog (null, "Driver loaded");
    Connection con = DriverManager.getConnection ("jdbc:oracle:thin:@//localhost:1521/xe", "SYSTEM", "root");
    JOptionPane.showMessageDialog (null, "database connected");

    This all works fine and I can perform queries and transactional instructions within the instance of java.

    However, I can't call stored procedures that I will receive a null pointer exception. The stored procedure, I try to call returns values however I know it works as I can run it in SQL Developer. The code below is the statement that calls the stored procedure, alll the sources I looked at it's correct, I also tried, cs.executeUpdate and Resultset rs when you try to call the java statement.

    public void thread_actionsperformed (ActionEvent c) //generates son
    {
    Try
    {
    CallableStatement cs = con.prepareCall ("{call PROCEDURE2}"); Calls a stored procedure that would generate threaded emails
    CS. Execute();
    JOptionPane.showMessageDialog (null, "Algorithm Threading successfully Executed");
    }
    catch (SQLException ex)
    {
    ex.printStackTrace ();
    JOptionPane.showMessageDialog (null, "Threading algorithm Executed without success"); Error response
    }
    catch (NullPointerException ex)
    {
    ex.printStackTrace ();
    JOptionPane.showMessageDialog (null, "Threading algorithm Executed without success"); Error response
    }
    }

    The Java application cannot 'see' the sp? Or is it something to do with privileges? I was puzzled by this during some time now, any help would be greatly appreciated.

    java.lang.NullPointerException
    at ETA_Final.thread_actionPerformed (ETA_Final.java:332)
    to ETA_Final$ 5.actionPerformed(ETA_Final.java:141)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    in javax.swing.AbstractButton$ Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
    in javax.swing.plaf.basic.BasicMenuItemUI$ Handler.mouseReleased (BasicMenuItemUI.java:1264)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Thank you and best regards,

    K

    Published by: Outbound86 on April 28, 2010 13:58

    Hi Kev,

    I expected this - so is it possible that your dumb object is null when you are in the ActionListener who manages the procedures?
    How will you spend until you use it (line 332), are you using Threads?

    Thnaks,
    Ivaylo

  • Call stored procedures in the object module and application of entity

    Hello

    I've implemented a helper methods that contains the EntiyImpl base class to call stored procedures.

    Now, I need to call procedures stored from the module of the application.

    Apart from the creation of a module base class asks and the programme of assistance of duplication of code in the method is possible
    to share methods of assistance for calling stored procedures between the entity impl and application module impl?


    Concerning
    Paul

    Support code depends on characteristics of an object instance given entity beyond its database transaction?

    If so, I'm not sure I see how it could be used with a class of application module.

    Otherwise, here's what you do:

    Step 1:

    Set up the database transaction - you can even choose to. So instead of

    {myHelperMethod (Object someParam) protected
    DBTransaction trans = getDBTransaction();
    ...
    }

    This is for change

    protected myHelperMethod (DBTransaction trans, someParam Object) {}
    ...
    }

    Step 2: make the method public and static - once you set DBTransaction, you should be able to do.

    public static myHelperMethod (DBTransaction trans, someParam Object) {}
    ...
    }

    Step 3: Remove your EntityImpl base class method in a utility class:

    Public MustInherit class PlSqlUtils {}
    private PlSqlUtils() {}

    public static myHelperMethod (DBTransaction trans, someParam Object) {}
    ...
    }
    }

    When you call the method of application module, object entity or class of same view object, call

    PlSqlUtils.myHelperMethod (getDBTransaction (), paramValue);

    Unlike Transaction.executeCommand (), allows you to provide features like the setting procedure of parameter values, recovery of the values of the parameters, etc.

    Hope this helps,
    Avrom

  • error when calling NtSetTimerResolution in NTDLL 1097. DLL

    I get 1097 error when calling NtSetTimerResolution in NTDLL. DLL. why?   I scoured most of the posts on this forum describing the 1097 error and tried the solutions without success.

    This is a link to the function prototype (copied below) that I adapted in the node call the attached vi library (you will be asked to locate NTDLL. DLL on your system when opening it)

    NtSetTimerResolution and NtQueryTimerResolution are defined as follows. All hours are stated in hundreds of nanoseconds.

    NTSTATUS NtSetTimerResolution (
    IN ULONG RequestedResolution,
    IN BOOLEAN
    defined.
    ON PULONG ActualResolution
    );

    Parameters

    RequestedResolution

    The desired timer resolution. Must be the legal scope of the system timer values supported by NT. The standard x 86 systems it's 1 to 10 milliseconds. The values that are within the acceptable limits are rounded to the next higher standard x 86 HAL millisecond limit. This parameter is ignored if the Set parameter is set to FALSE.

    Set

    This is TRUE if we ask a new resolution of the clock, and FALSE if the application is indicating that he hasn't needed a resolution already implemented.

    ActualResolution

    The resolution of timer in effect once the call is returned in this parameter.

    Woohoo! I solved the problem.

    I was using a copy of NTDLL. DLL C:\Drivers\I386\SYSTEM32\NTDLL here. DLL (version 5.1.2600.1106)

    instead of C:\WINDOWS\system32\ntdll.dll here (version 5.1.2600.5755).

    An observation aside Interestingly enough, I did, when I tried to put the old version in C:\WINDOWS\system32 to see if it was just a problem of dependence, rather than a version number, I couldn't do it!  I tried renaming C:\WINDOWS\system32\ntdll.dll C:\WINDOWS\system32\ntdll.dll.old and immediately a replacement c:\windows\system32\ntdll.dll pop up would be in his place! I even tried to drag / drop of C:\Drivers\I386\SYSTEM32\NTDLL. DLL C:\WINDOWS\system32\ntdll.dll, it seemed to replace, but a system of security immediately replaced it with the latest version.   WinXP is smarter than I thought, or maybe something like Microsoft Windows Defender Antispyware installed by our company does this.

    In any case, I've confirmed lateer version is necessary because when I copied C:\WINDOWS\system32\ntdll.dll to C:\Drivers\I386\SYSTEM32\NTDLL. DLL, it also solves the problem.

    You might well ask why I did not use the correct version in the first place - well not knowing where he was, I only noticed the old version when I searched for it with my Google Desktop.

    Rgds

  • Case function can be used as a parameter when calling a procedure, please advise...

    Case function can be used as a parameter when calling a procedure, please notify

    The daily procedure is called with the parameter 3 following one of the parameters using a function box between them as shown below.

    Daily_Ins (c1.p_mtrid, c1.p_UOM CASE WHEN "KWH" THEN 1 ELSIF 'KW' THEN 2 END, v_dateHold);

    In my opinion, using decode is illegal, so I think that I cannot say something like :

    Daily_Ins (c1.p_mtrid, ( decode c1.p_UOM, "KWH", 1 'KW', 2), v_dateHold);

    I think I just found something on the net

    SQL > DECLARE

    2 wages NUMBER: = 20000;

    3 employee_id NUMBER: 36325 =;

    4

    5 PROCEDURE give_bonus (emp_id in NUMBER, bonus_amt number) IS

    6 BEGIN

    7 DBMS_OUTPUT. Put_line (emp_id);

    8 DBMS_OUTPUT. Put_line (bonus_amt);

    9 END;

    10

    BEGIN 11

    12 give_bonus (employe_id,

    13 CASES

    14 salary when > = 10000 AND salary<=20000 then="">

    15. WHAT salary > 20000 AND salary<= 40000="" then="">

    16. WHAT > 40000 salary THEN 500

    17 0 OTHERWISE

    18 END);

    END 19;

    20.

    PL/SQL procedure successfully completed.

  • Error when calling bean 'delivery': waiting for reply has expired.

    Hello

    I run a process that currently catches an exception since a partnerlink. When the exception is caught, I send an email and the process stops. When I submit an application since the BPEL console, I have to wait the JTA timeout before the return of the page. However, the instance goes smoothly and I got the email before the time-out occurs. That's what I see in the newspapers. When I look at the audit workflow and activity, all activities were time-stamped before throwing exception. Has anyone seen this problem or knows what is happening. Is there a problem of in a catch block or catch-all mail?

    < 2009-04-19 22:33:41, 859 > < ERROR > < iCareTest.collaxa.cube > < BaseCubeSessionBean::logError > error when the bean 'delivery': waiting for reply has expired. The conversation id is cf9324c9be114336:513ede58:120c17e1922:-7 fc 0. Please check the detail process instance.
    com.oracle.bpel.client.delivery.ReceiveTimeOutException: waiting for reply has expired. The conversation id is cf9324c9be114336:513ede58:120c17e1922:-7 fc 0. Please check the detail process instance.

    Thanks in advance

    Jim

    There is no question why it happens to expire is because you don't have a response to the client in your tote.

    If you look at your processes, you will see that the default response is in the main field of application. When the Tote is called this response is in the past, that's why no reply is sent.

    Please answer in your catch all back to the client and it will work.

    see you soon
    James

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

    Hi all, I use jdeveloper 11g

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

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

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

    Any suggestions?

    Thank you.

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

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

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

    Timo

  • java.sql.SQLException: ORA-06550 and ORA-00900 call stored procedures

    Hi all

    I have 2 a stored procedures that I want to call from my Session bean. One of them takes a few settings, but not the other. When I call the procedures, I get the following errors described below. I tested the two stored procedures in sql plus and sqldveleoper and they work well. The funniest, it is, I have another stored procedure that I can call successfully from the same bean in session with no problems, so I'm a bit confused as to why his play now.

    I use stand-alone 10.1.3.4 OC4J and Oracle 10 g Db 10.2.0.4 and platform DB that I use is Oracle10gPlatform and Eclipselink as my JPA provider. I have also tried against toplink (not toplink essentials) and still no joy

    Here is the error I get when I try and call the procedure which takes the parameters of the session bean
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'HASHDATA'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    
    Error Code: 6550
    Call: BEGIN HashData(input=>?, hashedValue=>?, hashed=>?); END;
         bind => [password1, => hashedValue, => hashed]
    Query: DataReadQuery()
    Here are my stored procedure that take parameters
    create or replace procedure hashData(input IN VARCHAR2, hashedValue OUT BLOB, hashed OUT BOOLEAN)  as  
    
    inputRaw RAW(2000);
    --hashed BOOLEAN := false;
    begin 
    
    dbms_output.put_line('the data to be hashed is '||input);
    
    dbms_output.put_line('converting input to raw ...');
    inputRaw := utl_i18n.string_to_raw(input,'AL32UTF8');
    
    dbms_output.put_line('Hashing Data ...');
    hashedValue := DBMS_CRYPTO.Hash (src=>inputRaw,typ=>DBMS_CRYPTO.HASH_SH1);
    
    dbms_output.put_line('hash is '||UTL_I18N.raw_to_char(dbms_lob.substr(hashedValue, 4000,1)));
    
    if (hashedValue  is not null) then 
     
    
     hashed :=true;
      dbms_output.put_line('hashedValue IS NOT  null');
     else
     hashed := false;
      dbms_output.put_line('hashedValue IS null');
     end if;
    
    end;
    Here is my code in the session bean to call the procedure that takes as parameters (Hashdata)

    public UserBean() {
              // TODO Auto-generated constructor stub
    
              sessMan = SessionManager.getManager();
              session = sessMan.getSession("Session", Thread.currentThread()
                        .getContextClassLoader());
    
         }
    
    public Serializable hashData(String input){
    
              logger.debug("Hashing Data ... "); 
              hashedValue= null; 
              boolean hashed=false; 
         
              StoredProcedureCall call = new StoredProcedureCall();
    
              ValueReadQuery query = new ValueReadQuery();
              call.setProcedureName("HashData");
              call.addNamedArgumentValue("input", input);
              call.addNamedOutputArgument("hashedValue", "hashedValue", java.sql.Blob.class);
              call.addNamedOutputArgument("hashed", "hashed", java.lang.Integer.class);
                        
              query.addArgument("input");
              
              query.setCall(call);
              
              session.executeQuery(query);
               
              if ((Boolean)hashed){
                   logger.debug("The data has been hashed and the hash value is: "+hashedValue);
              }
              
              else{
                   logger.debug("The data has could not be hashed");
                   hashedValue=null;
              }
              
              return (Serializable)hashedValue;
              }
    When I call the other takes no parameters, I get the following error.
    Internal Exception: java.sql.SQLException: ORA-00900: invalid SQL statement
    
    Error Code: 900
    Call: BEGIN testJPAProc(); END;
    Query: DataReadQuery()
    Here is the procedure which takes no parameters
    create or replace procedure testJPAProc is 
     
     begin
     dbms_output.put_line('testJPAProc called');
     end;
    Heres is the code to call procedures that take no parameters
                                    StoredProcedureCall call = new StoredProcedureCall();
      
              ValueReadQuery query = new ValueReadQuery();
              
              call.setProcedureName("testJPAProc");
              query.setCall(call);
              
              session.executeQuery(query);
    You guys can tell me where I'm wrong if I do something wrong. Why make these mistakes? because as far as I can tell the code (java and pl/sql) are both correct unless there is something I missed. It's kinda funny because I have another stored procedure I can call successfully.


    Thank you

    The first question is that the Boolean in Oracle is not a supported JDBC type, but a PLSQL type.
    Change to an INTEGER is probably the best, you can also use the PLSQLStoredProcedureCall class to access.

    The second problem is perhaps that the stored procedure is not valid, make sure that it compiled correctly. It can also be the type of your query, you must use a DataModifyQuery, not a read request that it returns nothing.
    If still no luck, try to call directly through JDBC, it works?

    ---
    James: http://www.eclipselink.org: http://en.wikibooks.org/wiki/Java_Persistence

  • Calling stored procedures with parameters with the database connectivity Toolkit

    Hi all

    I'm new to the forum and struggling to find a solution to a particular problem I have in this respect, using the LabVIEW Database Connectivity Toolkit on a project, I am currently working on my work.  I have a database in which I tables and stored procedures with parameters.  Some of these stored procedures have input, output and return parameters.

    I tried to follow this example, but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument

    Such a stored procedure I am working on the implementation is named "dbo.getAllowablePNs", running "SELECT * from DeviceType" (DeviceType is the table).  In this case, it requires no input parameter, it has an output parameter that generates the table [cluster] and has a return parameter that returns an integer value (status code for execution) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int not null), PN (nvarchar ((15), null) and NumMACAddresses (int, null).)  I have surpassed many examples and I talk to the support OR try to implement this and similar procedures stored in LabVIEW but have not been successful.  I am able to connect to the database with the VI of open connection without error, but spin in some confusion as a result of this step.  I then try to use the VI of parameter query create to call the stored procedure and set the parameters.  I guess I would then use the Set parameter value for each parameter that is connected to the entry of parameters on the previous query with parameters VI VI?  I am also having some confusion during and after these steps as well.  I would greatly appreciate advice or suggestions that anyone could have in this situation because I am not a SQL expert.  Also, I would be happy to provide more information that might be useful.

    Kind regards

    Jon

    Here's what I use to do this.  I think I had to change him create parameterized query VI for him to work.  There is a post on the forum about this somewhere.

  • Calling stored procedure with an input of DATE parameter

    Hello. A question about the Date input parameters when you call a stored procedure.

    I have a procedure that takes a DATE as input parameter. I would DATE this value to include a time element.

    My Application Module method takes an input as a java.util.Date (myParamDate) parameter - that will preserve a time element (?).

    However when I create the CallableStatement, I am trying to set the parameter using setDate like this (for the param 5):
                st = getDBTransaction().createCallableStatement("begin cs_my_pck.request_values(?,?,?,?,?,?,?,?); end;", 0);            
                Connection myConn = st.getConnection();
                ArrayDescriptor myArrDesc  =  ArrayDescriptor.createDescriptor("CS_FIELD_TABT", myConn);
                Array sqlParamNameArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramNames.toArray());
                Array sqlParamValueArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramValues.toArray());
                Array sqlFilterNameArray = new oracle.sql.ARRAY(myArrDesc,myConn,filterNames.toArray());
                    
                st.setString(1, repType);
                st.setObject(2, sqlParamNameArray);
                st.setObject(3,sqlParamValueArray);
                st.setObject(4,sqlFilterNameArray);
    
                java.sql.Date myRepDate = new java.sql.Date(myParamDate.getTime());
    
                st.setDate(5,myRepDate);
                
                System.out.println("Report Date = " + myRepDate.toString());
                st.setString(6,repUser);
                st.setString(7,repAttach);
                // set out param
                st.registerOutParameter(8, Types.NUMERIC);
                st.execute();
    I understand java.sql.Date does NOT include a time element. But setDate() only accepts a java.sql.Date so my parameter of the procedure ends with a zero time element.

    How to call this procedure keeping the time element?

    Thank you.

    It includes the time element, if you want more precision with time stamp.

    http://docs.Oracle.com/javase/6/docs/API/Java/SQL/date.html

  • Call stored procedure in the URL

    Hi all

    How to call a stored procedure 4 Apex in the URL. The error is less.

    The requested URL/apex/EXAMPLE. TESTPROCEDURE was not found on this server.

    Thank you.

    802263 wrote:
    Hi all

    How to call a stored procedure 4 Apex in the URL. The error is less.

    The requested URL/apex/EXAMPLE. TESTPROCEDURE was not found on this server.

    Thank you.

    Should work on the assumption that:

    1. the scheme of analysis can 'see' the object such as defined by synonyms, etc.
    2. the schema of analysis has execute privs on the object.

Maybe you are looking for

  • Satellite L300-1BW - WLan disconnected about 10-15 minutes

    I own the: (Toshiba - Satellite L300-1BW) I thought I fixed this problem last night.Unfortunately, I was wrong. So far I've updated driver and BIOS on my laptop. My problem: OK so my internet works fine wirless thought when my laptop is not charging.

  • old opschonen schijf

    ALS ik op facabook talk wil. Ik wil een gesprek start is een vriend said kan niet. ALS ik contact try you will met f talk. Dan ik heel kort mijn vrienden lijst eventjes squeeze you zien. En dan gaat mijn vrienden van het scherm van mijn computer af l

  • time and time zones

    I have two children that I manage accounts on 4 different computers: 2 desktops and 2 laptops.   We live in one time zone but periodically they take their portable several time zones away to visit their grandparents. While they are gone, I want to ma

  • As Windows has stopped working

    Hi all, I am trying to transfer or copy music files from my hard drive on a USB drive but get the msg "Windows Eplorer has stopped working and will stop" he stops and restarts immediately. I use Windows 7 Home Premium. What to do? Thank you

  • Windows 7 complete edition; Windows Update does not work, cannot install SP1 failed to install Security Essentials, ect...

    I have a laptop Alienware M17x R2 that was running Windows 7 Ultimate SP1. Recently, the hard drive crashed. I replaced the hard drive and reinstalled the operating system using my recovery disks.Loading Windows 7 Ultimate without SP1 recovery disks.