Create Oracle BLOB and Pass to Oracle Stored Procedure

Hi All,
I am using Oracle 10g and am dealing with a requirement where I have to upload a file to Oracle Portal from the client's local machine using a JSP.
I am planning to convert the text file to a BLOB and pass it to an Oracle stored procedure which does the rest.
I am unable to create a BLOB object. Can anybody help me with this please.
Is there a better alternative to do it?
Thanks in advance,
Shardul

u can create blob as below...
java.sql.Blob blob=new Blob();
File file=new File(fullPathTo UrFile);
FileInputStream fInSteam = new FileInputStream(file);
BufferedInputStream bInputStream = new BufferedInputStream(fInSteam);
ByteArrayOutputStream bOutputStream = new ByteArrayOutputStream();
int nextByte;
while (( nextByte = bInputStream.read() ) != - 1)
bOutputStream.write(nextByte);
byte[] byteContent = bOutputStream.toByteArray();
blob.setBytes(byte[]);
i think it should work for u...

Similar Messages

  • Creating Fault Handling and Exception in Oracle BPEL

    I am following BPELtutorial-Orderbooking.pdf and have successfully reached chapter 6 i.e. Creating Fault Handling and Exception in Oracle BPEL. Everything went fine except this one... i.e. after implementing the Fault Handling and Exception in Oracle BPEL when I execute my process and enter CustId that begins with 0.... the invokeCR generates error message as follows as expected:
    <NegativeCredit xmlns="http://services.otn.com">
    <part name="payload">
    <error xmlns="http://services.otn.com">Bankruptcy Report</error>
    </part>
    </NegativeCredit>
    However, the execution proceeds ahead instead of terminating. The tutorial states that the BPEL process should terminate as the SSN is invalid, can anyone please tell me whats going wrong.. ?

    Well not exactly.... but when click on the 'Audit' sheet under BPEL Console for this instance, I can see the following:
    invokeCR (faulted)
    [2006/03/20 10:35:07] "{http://services.otn.com}NegativeCredit" has been thrown. less
    <NegativeCredit xmlns="http://services.otn.com">
    <part name="payload">
    <error xmlns="http://services.otn.com">Bankruptcy Report</error>
    </part>
    </NegativeCredit>
    The above is exactly what the tutorial states will be the output, so I presumed that the exception must have fired !

  • Creating remote objects and passing the retrieved data to modules

    I found at this Adobe tutorial a nice "RemoteService" class that  creates a RemoteObject and contains the functions for handling the  result and fault events. If I wanted to use this approach, how could I  pass the data from the result handler to interfaces that modules from  the main application could use?
    I could put the RemoteService/RemoteObject in the modules, but (in my  opinion- and I could be wrong) the best design seems to be using the  remote calls in the main app and passing the data along to the modules.
    Ultimately, I would like to know what the "best practices" are for creating remote objects and passing the retrieved data to modules
    Thanks!

    public void mouseClicked(MouseEvent e) {
      X x = new X(e.getX(), e.getY());
    }I don't see the difficulty.

  • Registering oracle forms and reports in oracle apps 11i

    Hi all
    I am a newbie to oracle apps
    could someone please help me with registering oracle forms and reports in oracle apps 11i
    thanking in advance
    regards
    oracle user

    Hi,
    regarding adding (Add (C:\ABC) to FORMS60_PATH in the registry) could you please explain
    compilation is by f60gen @ (is this right?)Correct, the syntax of using f60gen is explained in (Note: 130686.1 - How to Generate Form, Library and Menu for Oracle Applications).
    The place where i am working has apps installed in IBM AIX server .. so how do i access Apps
    or can i access Apps via TOAD.You will have to access the server using ftp to download the pll files to your local machine. TOAD can be used to access the database objects only (not the physical application files).
    Regards,
    Hussein

  • Creating a Record structure and passing this to a Procedure

    Hi there
    I have a query please.
    Can I create a Record Structure composed of fields
    from different tables and then pass this record structure
    to a procedure.?
    ie Create Procedure ProcedureTest(empRec empStructCreated%ROWTYPE)
    where empStructCreated is the RECORD STRUCTURE created
    and composed of fields from different tables.
    Please can some one help me on this.
    Assume that I have 3 tables and I am creating a record structure
    composed of 6 fields (2 fields from each of the 3 tables),and then
    once this record structure is created,I will be passing this to
    a procedure.

    SQL> create or replace package my_package as
      2  type my_rec is record (empno number,deptno number,dname varchar2(10),hiredate date);
      3  end;
      4  /
    Package created.
    SQL> create or replace procedure my_proc(rec1 my_package.my_rec) is
      2  begin
      3  dbms_output.put_line(rec1.empno||' '||rec1.dname||' '||rec1.hiredate);
      4  end;
      5  /
    Procedure created.
    SQL> declare
      2  rec1 my_package.my_rec;
      3  begin
      4  select empno,emp.deptno,dname,hiredate into rec1
      5  from emp,dept where  emp.deptno = dept.deptno and rownum =1;
      6   my_proc(rec1);
      7  end;
      8  /
    7369 RESEARCH 17-DEC-80
    PL/SQL procedure successfully completed.
    SQL>

  • Size limitation that can be passed to Java stored procedure

    Hello!
    I enjoy using Oracle8i these days. But I have some questions
    about Java stored procedure. I want to pass the XML data to Java
    stored procedure as IN parameter. But I got some errors when the
    data size is long. Is there any limitation in the data size that
    can be passed to Java stored procedure?
    Would you please help me ?
    This message is long, but would you please read my message?
    Contents
    1. Outline : I write what I want to do and the error message I
    got
    2. About the data size boundary: I write about the boundary
    size. I found that it depend on which calling sequence I use.
    3. The source code of the Java stored procedure
    4. The source code of the Java code that call the Java stored
    procedure
    5. The call spec
    6. Environment
    1.Outline
    I want to pass the XML data to Java stored procedure. But I got
    some errors when the data size is long. The error message I got
    is below.
    [ Error messages and stack trace ]
    java.sql.SQLException: ORA-01460: unimplemented or unreasonable
    conversion reque
    sted
    java.sql.SQLException: ORA-01460: unimplemented or unreasonable
    conversion reque
    sted
    at oracle.jdbc.ttc7.TTIoer.processError(Compiled Code)
    at oracle.jdbc.ttc7.Oall7.receive(Compiled Code)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(Compiled Code)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch
    (TTC7Protocol.java:721
    at oracle.jdbc.driver.OracleStatement.doExecuteOther
    (Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch
    (Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecute(Compiled
    Code)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Compiled
    Code
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate
    (OraclePrepar
    edStatement.java:256)
    at oracle.jdbc.driver.OraclePreparedStatement.execute
    (OraclePreparedStat
    ement.java:273)
    at javaSp.javaSpTestMain.sample_test
    (javaSpTestMain.java:37)
    at javaSp.javaSpTestMain.main(javaSpTestMain.java:72)
    2. About the data size boundary
    I don|ft know the boundary that I got errors exactly, but I
    found that the boundary will be changed if I use |gprepareCall("
    CALL insertData(?)");|h or |gprepareCall ("begin insertData
    (?); end ;")|h.
    When I use |gprepareCall(" CALL insertData(?)".
    The data size 3931 byte ---&#61664; No Error
    The data size 4045 byte ---&#61664; Error
    Whne I use prepareCall ("begin insertData(?); end ;")
    The data size 32612 byte --&#61664;No Error
    The data size 32692 byte ---&#61664; Error
    3. The source code of the Java stored procedure
    public class javaSpBytesSample {
    public javaSpBytesSample() {
    public static int insertData( byte[] xmlDataBytes ) throws
    SQLException{
    int oraCode =0;
    String xmlData = new String(xmlDataBytes);
    try{
    Connection l_connection; //Database Connection Object
    //parse XML Data
    dits_parser dp = new dits_parser(xmlData);
    //Get data num
    int datanum = dp.getElementNum("name");
    //insesrt the data
    PreparedStatement l_stmt;
    for( int i = 0; i < datanum; i++ ){
    l_stmt = l_connection.prepareStatement("INSERT INTO test
    " +
    "(LPID, NAME, SEX) " +
    "values(?, ?, ?)");
    l_stmt.setString(1,"LIPD_null");
    l_stmt.setString(2,dp.getElemntValueByTagName("name",i));
    l_stmt.setString(3,dp.getElemntValueByTagName("sex",i));
    l_stmt.execute();
    l_stmt.close(); //Close the Statement
    l_stmt = l_connection.prepareStatement("COMMIT"); //
    Commit the changes
    l_stmt.execute();
    l_stmt.close(); //Close the Statement l_stmt.execute
    (); // Execute the Statement
    catch(SQLException e ){
    System.out.println(e.toString());
    return(e.getErrorCode());
    return(oraCode);
    4. The source code of the Java code that call the Java stored
    procedure
    public static void sample_test(int num) {
    //make data
    Patient p = new Patient();
    byte[] xmlData = p.generateXMLData(num);
    try{
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection m_connection = DriverManager.getConnection
    ("jdbc:oracle:thin:@max:1521:test",
    "testuser", "testuser");
    CallableStatement l_stmt =
    // m_connection.prepareCall(" CALL insertData(?)");
    m_connection.prepareCall("begin insertData(?); end
    l_stmt.setBytes(1,xmlData);
    l_stmt.execute();
    l_stmt.close();
    System.out.println("SUCCESS to insert data");
    catch(SQLException e ){
    System.out.println( e.toString());
    e.printStackTrace();
    5. The call spec
    CREATE OR REPLACE PROCEDURE insertData( xmlData IN LONG RAW)
    AS
    LANGUAGE JAVA NAME 'javaSp.javaSpBytesSample.insertData(byte[])';
    6. Environment
    OS: Windows NT 4.0 SP3
    RDBMS: Oracle 8i Enterprise Edition Release 8.1.5.0.0 for
    Windows NT
    JDBC Driver: Oracle JDBC Drivers 8.1.5.0.0.
    JVM: Java1.1.6_Borland ( The test program that call Java stored
    procedure run on this Java VM)
    null

    Iam passing an array of objects from Java to the C
    file. The total size of data that Iam sending is
    around 1GB. I have to load this data into the Shared
    memory after getting it in my C file. Iam working on
    HP-UX (64-bit). Everything works fine for around 400MB
    of data. When I try to send around 500MB of data, the
    disk utilization becomes 100%, so does my memory
    utilization and I get a "Not enough space" when I try
    to access shared memory. I have allocated nearly 2.5GB
    in my SHMMAX variable. Also, I have around 45GB of
    disk free. The JVM heap size is also at 2048MB. Where did you get the 400/500 number from? Is that the size of the file?
    What do you do with the data? Are you doing nothing but copying it byte for byte into shared memory?
    If yes then a simple test is to write a C application that does the same thing. If it has problems then it means you have an environment problem.
    If no then you are probably increasing the size of the data by creating a structure to hold it. How much overhead does that add to the size of the data?

  • Parameter length limition passing to java stored procedure! help

    hi:
    i am working with java stored procedure to do some resource consuming work. i have to pass a long string (varch2) or bytes(log raw) which is larger than 32k which is the limitation
    set by oracle.
    is there a walk around?
    another question:
    i have to call java stored procedure from session beans ( weblogic app server) and how can i make sure the code
    in session beans and that in java stored procedures to be in
    the same transaction?
    regards
    daniel wang

    Hi Daniel,
    In answer to your first question: use a CLOB (for the long string)
    and a BLOB (for the long raw). Do a search for CLOB and BLOB at the
    Technet site:
    http://technet.oracle.com
    There are lots of resources including documentation and sample code.
    In answer to your second question: first, let me say that the J2EE
    forum is more suitable for that question (I haven't looked yet, but
    you may have posted there as well!). Anyway, you need to set an
    appropriate transaction attribute in your "ejb-jar.xml" descriptor
    file for your session bean. If you want to make sure that the
    session bean and java stored procedure participate in the same
    transaction, I suggest using "Required", as in:
    <trans-attribute>Required</trans-attribute>
    Hope this helps.
    Good Luck,
    Avi.

  • How to assign Values to nested table and pass as parameter to procedure?

    How to assign Values to nested table and pass as parameter to procedure?
    Below is the Object and its type
    create or replace type test_object1 as object
    val1 varchar2(50),
    val2 varchar2(50),
         val3 varchar2(50)
    create or replace type test_type1 is table of test_object1;
    create or replace type test_object2 as object
    val1 varchar2(50),
    val2 varchar2(50),
         val3 varchar2(50)
    create or replace type test_type2 is table of test_object2;
    GRANT ALL ON test_object1 TO PUBLIC;
    GRANT ALL ON test_type1 TO PUBLIC;
    GRANT ALL ON test_object2 TO PUBLIC;
    GRANT ALL ON test_type2 TO PUBLIC;
    here is the table made of object type:
    create table test_object_tpe
    sl_num NUMBER,
    description VARCHAR2(100),
    main_val1 test_type1,
    main_val2 test_type2
    NESTED TABLE main_val1 STORE AS tot1
    NESTED TABLE main_val2 STORE AS tot2;
    here is the procedure which inserts values into nested table:
    PROCEDURE INSERT_TEST_DATA(sl_num IN NUMBER,
    description IN VARCHAR2,
    p_main_val1 IN test_type1,
    p_main_val2 IN test_type2
    IS
    BEGIN
    FOR rec in p_main_val1.first..p_main_val1.last
    LOOP
    INSERT INTO xxdl.test_object_tpe
    sl_num,
    description,
    main_val1,
    main_val2
    VALUES
    sl_num
    ,description
    ,test_type1 (test_object1(
    p_main_val1(rec).val1,
                                       p_main_val1(rec).val2,
    p_main_val1(rec).val3
    ,test_type2 (test_object2( p_main_val2(rec).val1,
                        p_main_val2(rec).val2,
                        p_main_val2(rec).val3
    END LOOP;
    commit;
    END INSERT_TEST_DATA;
    here is the anonymoys block which assigns values to the object type and pass values into the procedure:
    set serveroutput on;
    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1(1).val1 := 'testx1';
    inval1(1).val2 := 'testx2';
    inval1(1).val3 := 'testx3';
    inval2(1).val1 := 'testy1';
    inval2(1).val2 := 'testy2';
    inval2(1).val3 := 'testy3';
    CSI_PKG.INSERT_TEST_DATA(sl_num => p_sl_num,
    description => p_description,
    p_main_val1 => inval1,
    p_main_val2 => inval2
    end;
    Can anybody correct me.
    Thanks,
    Lavan

    Thanks for posting the DDL and sample code but whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    >
    How to assign Values to nested table and pass as parameter to procedure?
    >
    Well you are doing almost everything wrong that could be done wrong.
    Here is code that works to insert data into your table (the procedure isn't even needed).
    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1.extend();
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    inval2.extend();
    inval2(1) := test_object2('testy1', 'testy2', 'testy3');
    INSERT INTO test_object_tpe
    sl_num,
    description,
    main_val1,
    main_val2
    VALUES
    (p_sl_num, p_description, inval1, inval2);
    commit;
    end;
    /See Example 5-15 Referencing a Nested Table Element in Chap 5 Using PL/SQL Collections and Records in the PL/SQL doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/collections.htm#CJABEBEA
    1. You don't even need the procedure since all it does is a simple INSERT into the table which you can do directly (see my code above)
    inval1(1).val1 := 'testx1';There is no element one (1) of 'inval1' since you haven't created any elements yet. You need to EXTEND the collection to add an element
    inval1.extend();And then there is an empty element but 'inval1' is a container for objects of type 'test_object1' not for scalars like 'val1', 'val2', and 'val3'.
    So you can't do
    inval1(1).val1 := 'testx1';You have to create an instance of 'test_object1'
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');And so on for the other collection
    You don't need the procedure (as my sample code shows) but once you populate the variables properly it will work.

  • How can i create a Global Temporary Table inside a Stored Procedure....

    Hi...
    I need to create a Global Temporary Table inside a Stored
    Procedure....
    I have no idea how to do that....
    Please....if u can send me a sample, send to me....
    Thanks a lot

    To create a global temporary table inside a stored procedure,
    the minimal syntax would be:
    CREATE OR REPLACE PROCEDURE procedure_name
    AS
    BEGIN
    EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE table_name'
    || '(column_name NUMBER)';
    END procedure_name;
    As Todd stated, it would probably be better to create the global
    temporary table outside of the procedure:
    SQL> CREATE GLOBAL TEMPORARY TABLE table_name
    2 (column_name NUMBER);
    Table created.
    You can also specify things like ON COMMIT PRESERVE ROWS or ON
    COMMIT DELETE ROWS.
    It may be that there is something else, like a PL/SQL table of
    records or a cursor, that would suit your needs better. It is
    difficult to guess without knowing what you want to do with it.

  • How Create a Global Temporary Table inside a Stored Procedure?

    Hi...
    I need to create a Global Temporary Table inside a Stored
    Procedure....
    I have no idea how to do that....
    Please....if u can send me a sample, send to me....
    Thanks a lot

    there are many ways to do this..
    one u can use dbms_utility package to run ddl statements like
    for ex:
    declare
    t varchar2(200):='order_no';
    v number;
    begin
    --dbms_utility.exec_ddl_statement('select '||t||' into '||v||'
    from
    --ordermaster where rownum=1');
    dbms_utility.exec_ddl_statement('create table cvt(t number)');
    dbms_output.put_line(v);
    end;
    but the actual method(recommended) involves a bit coding using
    dbms_sql package you will find examples on technet or metalink
    to use this package..
    I hope this helps
    Narendra

  • Creating/constructing a java.sql.Blob and writing to Oracle with jdbc

    I'm trying to understand how to create a blob from an image file to write it to a Oracle database using jdbc.
    I know there'a a getBinaryStream method in java.sql.Blob to which I can write the files byte array, but how do I create an actual blob in the first place. All examples I've seen initialise the blob from an exiting Blob field in a database which I do not have filled yet
    thanks

    In general, you will do something like the following:
    Ensure setAutoCommit is false
    INSERT INTO foo (blob_column) values (empty_blob());
    SELECT blob_column FROM foo FOR UPDATE;
    Call getBlob() on the ResultSet
    Cast it to Oracle's specific BLOB (different object)
    Call getBinaryOutputStream() on the BLOB
    Pipe your data
    Commit (very importatnt as FOR UPDATE will lock that row)- Saish

  • Help required in handling of Oracle BLOB and CLOB in OC4J

    Hi,
    I am in a process of porting my application from Weblogic 6 to OC4J.
    I have problem while handling CLob and Blob's in oracle. Weblogic has
    classes defined to do the same. (weblogic.jdbc.common.OracleClob)
    Does any one know how I can achieve this.
    Thanks in advance.
    Regards,
    Moin

    We have an application running on OC4J accessing an Oracle 8.1.7 db, and have no problems using BLOBs and CLOBs. It is explained quite clearly in the Oracle documentation.
    If you require further assistance let me know :-)

  • Pass BLOB as parameter to Packaged Stored Procedure

    Does JDBC (thin or otherwise) support passing a BLOB as a parameter to a packaged stored procedure in Oracle, or do we have to do an 'insert' statement to get it in?
    All the articles I've seen seem to refer to insert and select, but I want to strictly enforce all access to the database being through a package rather than table level access.
    We've certainly had no difficulty receiving blobs from the resultset returned by our packaged procedures.
    Any help appreciated,
    Thanks
    Jason.

    C5112736 wrote:>
    > And then these 2 formulas 'Formula # 1' and 'Formula # 2' can be used to pass on to the stored procedure.
    Can someone please demonstrate exactly how to use formula results as date parameters to a SQL stored procedure?  Keep in mind, there are two parameters to the stored procedure.
    I have gleaned this much: Use Add Command and insert the procedure with
    EXEC ServerName.dbo.usp_sprocName;1 '{?StringParameter}'
    but if I try to do
    {CALL ServerName.dbo.usp_SprocName({@Formula1},{@Formula2})}
    then it gives the error "No value given for one or more required parameters". 
    Both of the parameters are VARCHAR(50).
    I have finally found this link: [http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx|http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx]
    This Microsoft site defines the format of the ODBC escape sequences, but I still do not know how to convince Crystal to insert it's parameter results or formula results.
    Pulling what's left of my hair out . . .
    ~ Shaun

  • Need help!: How to covert Excel into BLOB and pass into procedure?

    Hi,
    I am writing a program in which I am uploading file from front-end and passing that file into Oracle procedure in BLOB format.
    Can someone help me ,that **how to convert Excel sheet into BLOB and then how we can pass that BLOB object to procedure in oracle*.
    Any help will greatly appreciated.
    Thanks

    Guys,
    I am able to convert FormFile into byutes using getFileData();
    But when I am tryint oconvert into BLOB,it is dhoowing me the error.
    Please find the complete details below.
    I am trying to Upload one file using FormFile of Struts and I need to pass that Form File into one procedure having BLOB as aIn parameter. SO I need to convert that file into BLOB object
    The code that I am trying is :
    try{
    BLOB blob= BLOB.getEmptyBLOB();
    System.out.println("before");
    blob.setBytes(theFile.getFileData());
    System.out.println("after");
    cs.setBlob(3, blob);
    }catch(Exception e){System.out.println("in the BLOB "+e);}
    After running the code,I am getting the following error
    java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Native Method)
    at oracle.jdbc.driver.DatumBinder.bind(OraclePreparedStatement.java:15839)
    at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:2865)
    at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2150)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3279)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3389)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4222)
    at dms.bo.impl.LoadManagement.UploadMetadataDAOImpl$1.doInCallableStatement(UploadMetadataDAOImpl.java:38)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:953)
    at dms.bo.impl.LoadManagement.UploadMetadataDAOImpl.getBlobString(UploadMetadataDAOImpl.java:28)
    at dms.web.action.LoadManagement.UploadMetadataAction.perform(UploadMetadataAction.java:33)
    at dms.web.action.common.BaseAction.execute(BaseAction.java:17)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619
    So with

  • Oracle 8..How to call stored Procedure to call stored Function

    Student here. Using Oracle 8, without Procedure Builder. Only have SQLPlus environment. Three simple code blocks follow:
    block One Creates a Function
    block Two Creates a Procedure
    ...However, I do not know how to Start, Run, Get..@ <or whatever command at SQL> prompt, to run the Procedure to call the Function.
    block Three is a script that calls the function, but I wish to call the stored procedure (from block Two above). My user manual PL/SQL Intro does not address.
    Please provide simple SQL Plus steps, command, path whatever.
    Very grateful to any or all who assist
    Wayne
    [email protected]
    -- CODE BLOCK #1 ----------------------------
    SQL>CREATE OR REPLACE FUNCTION COST_INCREASE_F (V_INCOMINGSAL NUMBER)
    2 RETURN EMP.SAL%TYPE
    3 IS
    4 V_NEWSAL EMP.SAL%TYPE;
    5 F_CONSTANT CONSTANT NUMBER :=1.05;
    6
    7 BEGIN
    8 V_NEWSAL := V_INCOMINGSAL * F_CONSTANT;
    9 RETURN V_NEWSAL;
    10
    11 END;
    12 /
    Function created.
    -- CODE BLOCK # 2----------------------------
    SQL>CREATE OR REPLACE PROCEDURE NEW_SALARY2
    2 IS
    3 V_SALFROMDBASE NUMBER;
    4 V_NEWVALFROMFUNC NUMBER;
    5
    6 BEGIN
    7 SELECT SAL
    8 INTO V_SALFROMDBASE
    9 FROM EMP
    10 WHERE EMPNO = 7839;
    11
    12 V_NEWVALFROMFUNC := COST_INCREASE_F(V_SALFROMDBASE);
    13
    14 DBMS_OUTPUT.PUT_LINE(V_SALFROMDBASE| |' '| |V_NEWVALFROMFUNC);
    15 END;
    16 /
    Procedure created.
    CODE BLOCK # 3---------------------------
    SQL>DECLARE
    2 V_SALFROMDBASE NUMBER;
    3 V_NEWVALFROMFUNC NUMBER;
    4
    5 BEGIN
    6 SELECT SAL
    7 INTO V_SALFROMDBASE
    8 FROM EMP
    9 WHERE EMPNO = 7839;
    10
    11 V_NEWVALFROMFUNC := COST_INCREASE_F(V_SALFROMDBASE);
    12
    13 DBMS_OUTPUT.PUT_LINE(V_SALFROMDBASE| |' '| |V_NEWVALFROMFUNC);
    14 END;
    15 /
    5000 5250
    PL/SQL procedure successfully completed.
    null

    Follow this steps to run the procedure.
    1. save the procedure in a folder in your hard disk as NEW_SALARY2.SQL.
    2. go to SQL*PLUS and then goto FILE->OPEN
    3. Then goto your folder where you have saved your procedure and then click once(only once) on the procedure name and then click cancel.
    4. Then type SQL>@NEW_SALARY2.SQL;
    it will execute your procedure.
    important: if you don't want to do that then
    type:
    SQL>exec c:\myfolder\NEW_SALARY2.sql
    it will execute your procedure.
    The same applies for your script.
    I hope this will help. If u still need help
    email me at [email protected]
    null

Maybe you are looking for

  • Space in disk decreases drastically after start

    I have a MacBook Air with 64 GB SSD, 8 GB RAM, OS 10.8.3. After I was running out of space, I used the amazing program GrandPerspective and found out a few things: - My sleepimage was 8 GB, taking a lot of space, but because it's exactly as my RAM, I

  • Why is the $.99 movie of the week $1.99?

    Wanted to rent the $.99 movie of the week but when I get to the movie page with the rental and purchase options, the rental price is $1.99.  If I rent it, will the price be adjusted in my account?  Thanks

  • Itunes uses half cpu on xp

    iTunes 10.5.0.142 is using 1/2 of the memory on my dual core HP using XP Media Edition.  Read some forums and found relief by using command "netsh winsock reset".   This removed the AppleMobileDeviceService.exe temporarily but had the side effect of

  • Consolidation Unknown Error

    After consolidation, i check messages, find many errors. I don't know why. Error Code:{4BAFAE85-A9EF-403B-B91A-6F2DB4E67D5B} System Message Summary Config consolidation muliti dimension data set. An unknown error has occurred in the HsvDSData2 object

  • WebLogic server's charset for writing files

    Hi! I have the following situation. Webapp (servlet) instantiates a class, which periodically writes data to files. The data is written to a file using the following code: fos = new FileOutputStream(outfile); //Don't wanna specify charset here fos.wr