How to call strored procedure in jDeveloper 9i

hello forum
i m working with jDeveloper 9i and i m getting problem
in executing the stored procedure in JDeveloper.Can any
one help me out to tell me the steps to execute the
stored procedures in jDeveloper.
thanks in advance

SRINU.AGNI wrote:
I want to call a .Net dll in oracle how i can make it plz let me knowYou can make calls to DLLs (or Shared Objects in Unix/Linux) using the external procedure (extproc) feature of Oracle.
I posted sample code of how it works on HP-UX in {message:id=2271919} - commenting that the approach on Windows will be pretty much the same.
There are however points to consider. What do you want the Oracle database instance to do in an external DLL? What service does this DLL provides and how does it fit Oracle ito concurrency, db consistency/transactions, security and so on? What are the data types of the parameter signature of the procedures of the DLL and are there equivalent PL data types that can be used? If the DDL uses C structs or IEEE floats for example, what PL types can be used to define the PL/SQL wrapper procedure?
It also limits the PL/SQL code (o/s agnostic) to a specific operating system (and even to specific 3rd party s/w that needs to be installed on that server). Is this a good idea? What happens when the o/s version changes or the o/s is replaced by another?
So yes, calling DLLs from PL/SQL via the extproc interface is possible. But this should be treated as an exception and sound reasoning and logic should drive the use of this feature.

Similar Messages

  • How to call one procedure from another procedure

    Hi all,
    Could anyone give me clue how to call a procedure contains out parameters
    from another procedure.
    I had following procedures.
    1)
    create or replace procedure INS_PUR_ORDER
    p_poamt in number,
    p_podate in date,
    p_poid out number
    is
    begin
    select pkseq.nextval into p_poid from dual;
    insert into pur_order(poamt,podate,poid)
    values (p_poamt,p_podate,p_poid);
    end;
    2)
    create or replace procedure INS_PUR_ORDER_DETAIL
    p_pounits in number,
    p_poddate in date,
    p_poid in number)
    is
    begin
    Insert into pur_order_detail(podid,pounits,poddate,poid)
    values(pdseq.nextval,p_pounits,p_poddate,p_poid);
    end;
    I need to write a 3rd procedure which calls above two procedures.
    like
    call first procedure ,basing on the return value
    i.e if p_poid != 0 then
    we need to call second procedure
    in the loop.
    thanks in advance.
    rampa.

    Not sure what are you doing, you can not assign cursor to another cursor, may be you are looking for this?
    SQL> create or replace procedure proc1 ( result out sys_refcursor)
      2  is
      3  
      4  begin
      5     open result for
      6       select 'HELLO WORLD' from dual ;
      7  end proc1 ;
      8  /
    Procedure created.
    Elapsed: 00:00:00.01
    SQL> create or replace procedure proc2
      2  is
      3     l_cursor sys_refcursor ;
      4  begin
      5     l_cursor := proc1 ;
      6   
      7  
      8     open l_cursor;
      9     fetch l_cursor into l_text;
    10     dbms_output.put_line(l_text);
    11     close l_cursor;
    12  
    13  
    14  end proc2 ;
    15  /
    Warning: Procedure created with compilation errors.
    Elapsed: 00:00:00.01
    SQL> show error;
    Errors for PROCEDURE PROC2:
    LINE/COL ERROR
    5/4      PL/SQL: Statement ignored
    5/16     PLS-00306: wrong number or types of arguments
             in call to 'PROC1'
    6/4      PLS-00201: identifier 'L_TEXT' must be
             declared
    6/4      PL/SQL: Statement ignored
    8/4      PLS-00382: expression is of wrong type
    8/4      PL/SQL: SQL Statement ignored
    9/4      PL/SQL: SQL Statement ignored
    9/24     PLS-00201: identifier 'L_TEXT' must be
             declared
    10/4     PL/SQL: Statement ignored
    10/25    PLS-00201: identifier 'L_TEXT' must be
             declared
    ---- this is the correct waySQL>ed
      1  create or replace procedure proc2
      2  is
      3     l_cursor sys_refcursor ;
      4     l_text varchar2(100);
      5  begin
    ---- procedure call
      6     proc1(l_cursor); 
    7    -- open l_cursor;
      8     fetch l_cursor into l_text;
      9     dbms_output.put_line(l_text);
    10     close l_cursor;
    11* end proc2 ;
    SQL> /
    Procedure created.
    Elapsed: 00:00:00.01
    SQL> set serveroutput on
    SQL> execute proc2;
    HELLO WORLD
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL>

  • How to call stored procedure in hibernate

    hi ,
    can any one help me how to call stored procedure in hibernate.Given code in hbm.xml
    and also plz tell me what is the use of <return-property/>in given hbm.xml file.
    <sql-query name="selectEmployees_SP" callable="true">
         <return alias="emp" class="com.centris.Employee">
    <return-property name="eno" column="eno"/>
    <return-property name="ename" column="ename"/>
    <return-property name="address" column="address"/>
    <return-property name="salary" column="salary"/>
    { ? = call p_retrieve_employees() }
    </return>
    </sql-query>

    Hi,
    Your question isn't related to Java Programming and should be asked in a [Hibernate forum|http://forum.hibernate.org/]
    Kaj

  • How to call this procedure in my report to print my procedure output

    Hi,
    i have a table named letter,it contains 2 columns named as letter_id and letter_content.
    select * from letter;
    letter_id letter_content
    103 Dear MFR
    103 This is in regards to the attached DM List
    103 Please Credit us after reviewing it.
    103 Thanks
    103 Regards
    103 xxxx
    108 Dear customer
    108 This is to inform that ur DM List is as follows
    108 Credit us according to the Dm after reviewing it.
    108 Thanks
    108 Regards
    108 xxxx
    now my requirement is,i need send a parameter as letter_id to a procedure or function in pl/sql in oracle,the output should be as follows:
    if we will pass parameter(letter_id) = 103 then it displays as follows:
    Dear MFR
    This is in regards to the attached DM List.Please Credit us after reviewing it.
    Thanks
    Regards,
    XXXXX.
    if we will pass parameter(letter_id) = 108 then it should displays as follows:
    Dear customer,
    This is to inform that ur DM List is as follows. Credit us according to the Dm after reviewing it.
    Thanks
    Regards,
    XXXXX.
    the procedure for my requirement is like below.now my problem is how to call this procedure in my report.so that if i will send a parameter as letter_id then it should get my report stated above.
    CREATE OR REPLACE PROCEDURE letter_text ( p_letter_id letter.letter_id%TYPE , p_letter_contents_out OUT SYS_REFCURSOR )
    IS
    BEGIN
    OPEN p_letter_contents_out
    FOR
    SELECT letter_content
    FROM letter
    WHERE letter_id = p_letter_id
    ORDER BY line_seq;
    END letter_text;
    which you might call with something like
    SQL> var results refcursor
    SQL> exec letter_text(103, :results)
    PL/SQL procedure successfully completed.
    SQL> print :results;
    CONTENT
    Dear MFR
    this is in regards to the attached DM List
    Please credit us after reviewing it
    thanks
    Regards
    EXP
    6 rows selected.
    so, the same out put i need to get it in a report.
    Thanks

    Thanks for ur suggestions.
    i have 2 select statements.1st query is the main query for the report.so i used it at the time of report created with datablock.
    now my 2nd query is
    select letter_content
    from ( select content_seq,
         content || case content_seq
    when 2 then
    ' ' || lead(content) over (partition by letter_id order by content_seq)
    end as letter_content
    from exp_letter_contents
         where letter_id = 103)
    where content_seq <> 3;
    i had taken 2parameters 1 for the main query and 2nd is for the above query(parameter is letter_id).
    now i have to write the above select statement in the report.
    so i had taken a field object in the report and then i had written this code in before report trigger.
    function letter_contentFormatTrigger return boolean is
    begin
    select letter_content
    from ( select content_seq,
                        content ||
                        case content_seq when 2 then
                             ' ' || lead(content) over (partition by letter_id order by content_seq)
                        end as letter_content
              from exp_letter_contents
              where letter_id = 103)
    where content_seq <> 3;
    return (letter_content);
    end;
    when i tried to compile it.i got an error as follows :
    error 103 at line6,column 5
    encountered the symbol "CASE" when expecting one of the following:
    (- + mod null <an identifier>
    <a double-quoted delimited-identifier><a bind variable> avg...etc
    so,where can i write this select statement.
    i am using oracle reports6i
    Message was edited by:
    user579585

  • How to call plsql procedure or function and getting back the string?

    Hi Everyone,
    i am using Jdev 11.1.1.5.0.
    i have a requirement to call plsql procedure or function from my backing bean java file and get back the returned value from the procedure or function.
    what piece of simple code i need to write in my backing bean?
    please suggest.
    Thanks.

    As always you write the method to call he pl/sql in the application module, expose this method to the client (so you see it in the datacontroll) then create a operation binding to the method and call this operation from the bean. The result you get by operation.getResult();
    You should never call pl/sql from the bean directly!
    The doc shows how to call the procedure from an application module: http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcadvgen.htm#sm0297
    Timo

  • How to call a procedure designed in Report Builder?

    Hi everyone,
    The Problem?
    I set up a procedure and would like to call this procedure in reports builder 6.0. I need to know how to call a procedure in reports builder.
    Thanks
    Tom Gilmore

    You can call
    procedures from a formula column's PL/SQL code.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Thomas Gilmore ([email protected]):
    Hi everyone,
    The Problem?
    I set up a procedure and would like to call this procedure in reports builder 6.0. I need to know how to call a procedure in reports builder.
    Thanks
    Tom Gilmore<HR></BLOCKQUOTE>
    null

  • How to call plsql procedure in jasper

    Hi,
    anybodys know how to call plsql in jasper..
    i have try this code in jasper -> select query langiuage = plsql
    {CALL STD03_MERIT_PROCESSING($P{std03_studentVal},$P{std03_studentVal})}
    but there is error taht said no data found..
    any idea
    Thnak You

    Hi,
    I know nada of Jasper, but it took a couple of seconds to find out that calling stored procedures aren't supported.
    There are number of articles describing work-arounds for that.
    This seems to be a good one:
    http://brianburridge.com/2006/06/04/how-to-call-stored-procedures-from-jasper-reports/
    Other suggests Hibername mappers or some bean approach,
    Regards
    Peter

  • How to call Stored procedure in SMP 2.3 ?

    HI Experts,
    I have stored procedure in SQL Server, in that i have Select query with WHERE Condition, how to call that procedure in SMP Application .

    Do you want to create mbo from that stored procedure?  Not sure if this document helps you Example: Parameters and Stored Procedures

  • How to call oracle procedure in JPA?

    Hi,
    I am new to JPA.
    Can one help with a piece of code on how to call a procedure in JPA?
    Thanks

    Use the search, I answered this last week.

  • How to call store procedure in query generator

    Hi All,
    How to call store procedure in query generator.
    Regards
    Rajkumar Gupta
    Edited by: Rajkumar Gupta on Dec 7, 2010 2:11 AM

    Hi,
    Please check the following threads.
    How to use Stored Procedure in sap business one
    How to add parameters to a stored procedure in B1 Query generator
    How to execute the procedure in sap b1
    Hope it helps,
    Vasu Natari.

  • How to call a procedure in place of a SQL

    Hi
    Can any one tell me how to call a procedure in place of a SQL from Bi publisher
    Thanks
    Ranga
    Edited by: user13274784 on Jul 22, 2010 9:47 AM

    One way would be to use pipelined table functions. Call the procedure within a function and return data in the form of a table.
    Search the forum.
    Check this out: http://winrichman.blogspot.com/search/label/pipelined
    http://bipublisher.blogspot.com/2007/09/plsql-taking-it-to-next-level.html
    BI publisher to use Stored Procedure
    Edited by: BIPuser on Jul 22, 2010 10:22 AM

  • How to call stored procedure from Pro*C

    How to call stored procedure from Pro*C ?
    my system spec is SuSE Linux 9.1, gcc version : 3.3.3, oracle : 10g
    my Pro*C code is the following..
    EXEC SQL EXECUTE
    begin
    test_procedure();
    end;
    END-EXEC;
    the test_procedure() has a simple update statement. and it works well in SQL Plus consol. but in Pro*C, there is a precompile error.
    will anybody help me what is the problem ??

    I'm in the process of moving C files (with embedded SQL, .PC files) from Unix to Linux. One program I was trying to compile had this piece of code that called an Oracle function (a standalone), which compiled on Unix, but gives errors on Linux:
    EXEC SQL EXECUTE
    BEGIN
    :r_stat := TESTSPEC.WEATHER_CHECK();
    END;
    END-EXEC;
    A call similar to this is in another .PC file which compiled on Linux with no problem. Here is what the ".lis" file had:
    Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Error at line 193, column 5 in file weather_check.pc
    193 BEGIN
    193 ....1
    193 PCC-S-02346, PL/SQL found semantic errors
    Error at line 194, column 8 in file weather_check.pc
    194 :r_stat := TESTSPEC.WEATHER_CHECK();
    194 .......1
    194 PLS-S-00000, Statement ignored
    Error at line 194, column 18 in file weather_check.pc
    194 :r_stat := TESTSPEC.WEATHER_CHECK();
    194 .................1
    194 PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
    Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    System default option values taken from: /oracle_client/product/v10r2/precomp/ad
    min/pcscfg.cfg
    Error at line 194, column 18 in file weather_check.pc
    :r_stat := TESTSPEC.WEATHER_CHECK();
    .................1
    PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
    Error at line 194, column 8 in file weather_check.pc
    :r_stat := TESTSPEC.WEATHER_CHECK();
    .......1
    PLS-S-00000, Statement ignored
    Semantic error at line 193, column 5, file weather_check.pc:
    BEGIN
    ....1
    PCC-S-02346, PL/SQL found semantic errors

  • How to call a procedure

    Hi,
    I know this a silly question..but i am not getting how to do.
    I have stored procedure with multiple OUT and IN parameters.But i want to use only one parameter to call the procedure, for example:
    create or replace
    PROCEDURE Get_NN_Distance ( nbrid OUT NUMBER
    , nbrTDistOut OUT NUMBER
    , nbrRHouse OUT NUMBER
    , nbrResDist OUT NUMBER
    , nbrBHouse OUT NUMBER
    , nbrBdist OUT NUMBER
    , nbrSIDIn IN NUMBER
    , nbrRefLatIn IN NUMBER
    , nbrRefLonIn IN NUMBER
    , nbrRadius IN NUMBER := 1000 -- Default to 200 ft.
    but i want to use only one parameter nbrSIDIn only.
    this parameter represents SITEID, If we give SITEID we can get LAT,Long for that siteid by using another table: i want to put nbrradius as default:
    how to call the procedure by using only SITEID:
    Can anyone help me in this Plz
    Thanks

    ramakrish wrote:
    I have stored procedure with multiple OUT and IN parameters.But i want to use only one parameter to call the procedure, The OUT parameters forces you to supply variables to receive these output values from the procedure.
    So instead, create a new procedure that serves as a wrapper procedure. Where this provides a single parameter only and makes the call on your behalf using multiple parameters. E.g.
    create or replace procedure Do_NN_Distance( sidIn number ) is
    .. local variables...
    begin
      Get_NN_Distance( 
        nbrSIDIn => sidIn,
        .. other params using local variables...
    end;BTW, I suggest that you reconsider using prefixes like "+nbr+" to indicate data type. Hungarian notation is dead. Especially in a strongly typed language.. especially in a an explicit variable type definition language.
    +"Encoding the type of a function into the name (so-called Hungarian notation) is brain damaged—the compiler knows the types anyway and can check those, and it only confuses the programmer."+
    Linus Torvalds

  • How to call stored procedures from EF 6.1.3

    Hi
    I need to create many reports and I wanna use SPs, with parameters, the question is how to use it from ntity Framework CodeFirst ? I am using EF 6.1.3
    I 've found examples using EF but not EF CF, any sample please ?
    thanks in advance
    Salu2 Sergio T

    You create a type to return and pass it as a type...
    Like this:
    http://stackoverflow.com/questions/20901419/how-to-call-stored-procedure-in-entity-framework-6-code-first
    context.Database.SqlQuery<YourEntityType>("storedProcedureName",params);
    ps
    That was pretty easy to google, by the way.
    And... it's not really wpf.
    Shrug.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How to call stored procedure from postgresql to jsp

    i'm using a jdeveloper.. and i'm a newbie of jsp.. i just wanna know how to call a stored procedure in jsp?... This is my function in postgres and i don't know how to call it in jsp...
    SELECT * from SP_1('2006-01-11') as ( company_code char(5), branch_category char(5), branch_code char(15), day_sales numeric(19,2), month_to_date numeric(19,2), no_of_transaction int8, month_to_date_py numeric(19,2), year_to_date numeric(19,2), year_to_date_py numeric(19,2), remarks text, time_reported text );

    hi again.. i'm using jsp in jdeveloper, i just wanna know how to declare double in jsp because my module is report and i need to get the average daily sales = 4500/ no. of transaction = 3. This is my code.. Where will i put the code in declaring the double and the average daily sales? Thanks in advance..
    <%@ page contentType="text/html;charset=windows-1252" import="java.sql.*,Connect.CRMCon"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>untitled</title>
    </head>
    <body>
    <%
    String ave = request.getParameter("ave_daily_sales");
    double cashsales = Double.parseDouble(ave);
    %>
    <%
    logparameters data = new logparameters();
    data.txtbox = request.getParameter("txtbox");
    %>
    <table cellspacing="3" cellpadding="2" border="1" width="100%">
    <tr>
    <td width="5%" bgcolor="#cccccc" height="29">
    <DIV align="center">Company Code</DIV>
    </td>
    <td width="4%" bgcolor="#cccccc" height="29">
    <DIV align="center">Branch Category</DIV>
    </td>
    <td width="6%" bgcolor="#cccccc" height="29">
    <DIV align="center">Branch Code</DIV>
    </td>
    <td width="8%" bgcolor="#cccccc" height="29">
    <DIV align="center">Day Sales</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Month to Date</DIV>
    </td>
    <td width="5%" bgcolor="#cccccc" height="29">
    <DIV align="center">No.of Transaction</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Month to Date(PY)</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Ave.Daily Sales to Date</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Year to Date</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Year to Date(PY)</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Remarks</DIV>
    </td>
    <td width="5%" bgcolor="#cccccc" height="29">
    <DIV align="center">Time Reported</DIV>
    </td>
    </tr>
    <%
    try
    CRMCon ccon = new CRMCon();
    Connection con = ccon.getConnection();
    String sql = "select * from sp_1('"+data.txtbox+"')";
    // String sql = "SELECT * from SP_1('"+ request.getParameter("data.txtbox")+"')" ;
    sql += " as (company_code char(5), branch_category char(5) ," ;
    sql += "branch_code char(15) , day_sales numeric(19,2)," ;
    sql += "month_to_date numeric(19,2), no_of_transaction int8," ;
    sql += "month_to_date_py numeric(19,2), year_to_date numeric(19,2)," ;
    sql += "year_to_date_py numeric(19,2), remarks text, time_reported text) " ;
    //out.println(sql);
    Statement st = con.createStatement();
    ResultSet rs = st.executeQuery(sql);
    while (rs.next())
    %>
    <tr>
    <td width="13%"> <%= rs.getString("company_code") %> </td>
    <td width="63%"> <%= rs.getString("branch_category") %> </td>
    <td width="24%"> <%= rs.getString("branch_code") %> </td>
    <td width="24%"> <%= rs.getString("day_sales") %> </td>
    <td width="24%"> <%= rs.getString("month_to_date") %> </td>
    <td width="24%"> <%= rs.getString("no_of_transaction") %> </td>
    <td width="24%"> <%= rs.getString("month_to_date_py") %> </td>
    <td width="24%"> <%= rs.getString("year_to_date") %> </td>
    <td width="24%"> <%= rs.getString("year_to_date_py") %> </td>
    <td width="24%"> <%= rs.getString("remarks") %> </td>
    <td width="24%"> <%= rs.getString("time_reported") %> </td>
    </tr>
    <%
    catch (Exception ex)
    out.println("Error:"+ex.getMessage());
    %>
    </table>
    </body>
    </html>
    <%!
    class logparameters
    public String txtbox;
    %>

Maybe you are looking for

  • /Contents entry in digital signatures

    Hi All, I have problem in making /Contents entry while trying to sign a PDF document.  Infact there is problem in Calculating ByteRange digest and then encrypting it. I have seen cryptographic message syntax v1.5. So I am using Signed-Data content ty

  • Changing item type programmatically

    We've created a custom item type and would now like to programmatically update existing CA items to use that type. Does anyone know of any API or examples to accomplish this? much appreciated, -john

  • Sending bytes issue

    Hi I am implementing an echo server and a client to measure RTT and throughput of a TCP link. I have been provided with a detailed protocol the server and client must follow. Here is the problem: The server at a certain point will be waiting for the

  • Configuring Netweaver administration on SLD system

    I have SLD configured in our landscape. I can see all systems in the system . Does anyone knwo how to configure NWA adminstration on same system  to admin all the systems through SLD ? Any pointer to white paper or OSS note will be helpful . I am see

  • T60: Loss of Audio

    I have a T60 and a docking station. When I plug the laptop into the docking station and close the lid I lose all audio output. This docking station does not have an Audio output so I have my headphones connected to the Green output on the laptop itse