DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Stored Procedure Compilation Error

  1. #1
    Join Date
    Dec 2001
    Location
    SAN FRANCISCO, CA
    Posts
    306

    Stored Procedure Compilation Error

    i have written a small procedure ,which stores the data in a table.
    and while calling it from the java code,itz throwing invalid object
    (invalid procedure name).
    while we compile it in sql,itz getting compile with no errors.

    please let me know where it is wrong.

    THE STORED PROCEDURE CODE
    ==========================
    create or replace procedure st_proc as
    declare id number;
    begin
    select word_id into id from words ;
    insert into words_desc values(id,'desc for first word');
    end;


    java code:
    =========
    try
    {
    con = getDBConnection();
    System.out.println("con = "+con);
    cs = con.prepareCall("{call st_proc}");
    System.out.println("cs = "+cs);
    cs.execute();
    }catch(SQLException e)
    {
    e.printStackTrace(System.out);
    System.out.println("................");
    System.out.println(e);
    }finally
    {
    try{
    cs.close();
    con.close();
    }catch(Exception e){}
    }
    Eat , Drink & Enjoy life -

    [email protected]

  2. #2
    Join Date
    Jan 2003
    Location
    Hull, UK
    Posts
    220
    Hi,

    Try to put it in a package and call it using

    pkgname.procedurename in ur java code.......

    Even i dont see any problems in the code.

    HTH

    Srini

  3. #3
    Join Date
    Jul 2003
    Location
    Sofia, Bulgaria
    Posts
    91

    Re: Stored Procedure Compilation Error

    Originally posted by pravin

    cs = con.prepareCall("{call st_proc}");
    cs = con.prepareCall("begin st_proc; end;"); I think

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width