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.

Similar Messages

  • How to call store procedure from an oci program

    Hello,
    I work on Oracle 8.1.7 under AIX.
    I must call from an OCI C++ program a store procedure that have an result set as param out.
    I'm not sure how can I call the procedure/function. I want to execute this statement and fetch the results.:
    " CALL Department.get_all (:1) " is this OK?
    " Call department.GetAll() into :1 "
    I have seen some example from an PL/SQL block but that's not ok for me.
    what i have done:
    i have created an package
    create or replace package department as
    type cursor_type is ref cursor;
    procedure get_emp( i_deptno in number, rs out cursor_type );
    procedure get_all( rs out cursor_type );
    function GetAll return cursor_type;
    end department;
    create or replace package body department as
    procedure get_emp ( i_deptno in number, rs out cursor_type )
    as
    begin
    open rs for
    select empno, ename
    from emp
    where deptno = i_deptno;
    end;
    procedure get_all ( rs out cursor_type )
    as
    begin
    open rs for
    select empno, ename
    from emp;
    end;
    function GetAll return cursor_type
    as
    l_cursor cursor_type;
    begin
    open l_cursor for select ename, empno from emp;
    return l_cursor;
    end;
    end;

    Hi,
    I am new to OCI facing the same problem you have mentioned, If you have found out how to solve it , can you post the answer for the same.
    Thanks
    Mani

  • About JDBC CALL STORE PROCEDURE with out parameter is greater than 4000

    Hi Guys,
    I have a problem call store procedure with a large string.
    as i know varchar2 can contain 32767 characters in pl/sql .
    But when i used varchar2 as a out parameter in a store procedure, if the out parameter is greater than 4000 characters , it always give me error message as 'the buffer is too small'.
    why it happened?
    I read some article that says i need configure a property in data-source.xml , and jdbc 10g driver already solved this problem, but i used jdev 10.1.3.2 ,the driver should be fine.
    How can i solve this problem?
    Thanks in advance,
    AppCat

    Object is Foundation, Execute Script
    This is for a query, you can change to a stored procedure call. Pull the value back in the Java code then put into the process variable.
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import java.sql.*;
    PreparedStatement stmt = null;
    Connection conn = null;
    ResultSet rs = null;
    try {
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:IDP_DS");
    conn = ds.getConnection();
    stmt = conn.prepareStatement("select FUBAR from TB_PT_FUBAR where PROCESS_INSTANCE_ID=?");
    stmt.setLong(1, patExecContext.getProcessDataLongValue("/process_data/@inputID"));
    rs = stmt.executeQuery();
    rs.next();
    patExecContext.setProcessDataStringValue("/process_data/outData", rs.getString(1));
    } finally {
    try {
    rs.close();
    } catch (Exception rse) {}
    try {
    stmt.close();
    } catch (Exception sse) {}
    try {
    conn.close();
    } catch (Exception cse) {}

  • 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 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

  • ADF 11, USING EJB, CALL STORE PROCEDURE, A PROBLEAM?

    ADF 11, USING EJB, CALL STORE PROCEDURE, A PROBLEAM?
    I have a store procedure:
    CREATE OR REPLACE PACKAGE BODY PK_HR1
    IS
    FUNCTION FUNC04
    RETURN CUR_RESULT
    IS
    X_CUR CUR_RESULT;
    BEGIN
    OPEN X_CUR FOR
    select mako, tenko, diachiko from kho;
    RETURN X_CUR;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE;
    END FUNC04;
    END PK_HR1;
    In the entities class, I have a NamedStoredProcedureQuery:
    @Entity
    @NamedStoredProcedureQuery(name="Kho.FUNC04",
              resultClass=Kho.class,
              procedureName="PK_HR1.FUNC04" )
    public class Kho implements Serializable {
    In session bean, i have a method
    public class SessionEJBBean implements SessionEJB, SessionEJBLocal
    public void test() throws Exception{
    try {
    //code here ...
    List<Kho> listKho = em.createNamedQuery("Kho.FUNC04").getResultList();
    System.out.println("aaaa");
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    I try running, but always show errror
    this errors:
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00221: 'FUNC04' is not a procedure or is undefined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call: BEGIN PK_HR1.FUNC04(); END;
    Query: ReadAllQuery(jp.co.mfr.sgs.bean.Kho)
    help help me?

    You need to use a CallableStatement for this.
    --olaf                                                                                                                                                                                                           

  • 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 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 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 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

  • To call Store procedure

    I log in in the Enterprise manager with the user "Nadia" that I created . I Created an escheme TEST and all the tables .
    I Created also the package with this user. It has a procedure that returns 1 cursor.
    This user has:
    atributte: CONNECT, DBA AND RESOUCE
    System: EXECUTE ANY PROCEDURE AND UNLIMITED TABLESPACE
    Is it correct?
    My application is access the oracle 9i with this user too.
    I have to call the procedure this way:
    SID.PACKAGE.PROCEDURE
    Im my vb code, I am call this way too.
    Code VB 6:
    With cmd
    .ActiveConnection = CNP
    .CommandText = "NADIA.EXT_DADOS.DADOS_VISITANTE" ????
    .Prepared = False
    .CommandType = adCmdStoredProc
    .Parameters.Append .CreateParameter("@Documento", adInteger, adParamInput, 15, 8384474)
    .Parameters.Append .CreateParameter("@nome", adChar, adParamInput, 1, lsTipo)
    Set ObReg = .Execute(, , adAsyncFetchNonBlocking)
    End With
    When execute, message errors show:
    The NADIA.EXT_DADOS.DADOS_VISITANTE needs to be declared.
    Wha is wrong?
    thank you
    Nádia

    It looks like you are getting appropriate feedback in one of the other threads on this topic that you've posted:
    To call Store procedure
    But I would have to say that I hope this is just a test system. I would never grant DBA, EXECUTE ANY PROCEDURE, and UNLIMITED TABLESPACE to a "normal" user in a production system.
    Good luck,
    Mark

Maybe you are looking for

  • How to delete the unix files automatically using the unix scripts

    Hi we have the ADF Project deployed on weblogic server running on top of Linux OS. But, our ADF running project is generating temporary files in weblogic server path below path /u01/oracle/product/Middleware/user_projects/domains/based_domain/servers

  • BAPI_ACC_INVOICE_RECEIPT_POST - State Withholding

    Hello All, I call BAPI_ACC_INVOICE_RECEIPT_POST and pass it tax withholding information in the EXTENSION.  This is then used to populate Structure ACCIT_WT.  When there is Federal withholding, the BAPI works correctly and automatically creates the Fe

  • Delta in Inventory

    HI All, Please clarify: 1.Does delta is working on what fileds in Inventory (2LIS_03_BF)? (MBELNR,MJAHR,ZEILE)?. 2.In RSA6 we checked this Delta enabled Data source. But how do we check the fields those are using for Delta extraction?. Thanks in adva

  • Windows or Mac for programming?

    I am in a dilemma that several people who are starting to gain footing in programming skills face when they begin to grow. Hoping to gain the advice from people that have been to the same choice, what is the best choice for a developer that would lik

  • Migrating BADI from 4.7 to ECC 6.0

    Dear Gurus, We r migrating from SAP 4.7 to ECC 6.0 We have one BADI - ME_PROCESS_PO_CUST where we have made changes according to the requirement After upgrading to ECC 6.0. This BADI is not working even though it is in active mode. Any specific proce