How to call PL/SQL stored procedure using ODBC?

Could anyone tell me how can I call PL/SQL stored procedure using
ODBC? Are there any sample codes?
Thanx!
null

You are correct on all counts, they all should work.
Oracle Product Development Team wrote:
: Hi,
: I don't know the exact syntax in ODBC, but reasoning by analogy
: with other API's, I'd bet one of the following works
: (for a call to: procedure my_proc(n1 number, n2 number);):
: "{ my_proc(1,2); }"
: "{ call my_proc(1,2); }"
: "{ begin my_proc(1,2); end }"
: "begin my_proc(1,2); end;"
: "begin my_proc(1,2); end"
: Hope this helps. - Pierre
: jiangbuf (guest) wrote:
: : Could anyone tell me how can I call PL/SQL stored procedure
: using
: : ODBC? Are there any sample codes?
: : Thanx!
: Oracle Technology Network
: http://technet.oracle.com
null

Similar Messages

  • How to call pl/sql stored procedure in JDBC query dialogbox

    Hi,
    how to call pl/sql stored procedure in JDBC query dialogbox(reports 9i) .
    Cheers,
    Raghu

    please refer : Re: problem If you have more doubts, please ask in that question.

  • How to call PL-SQL/stored procedure in Creator

    Anybody can tell how to call PL-SQL/Stored procedures inside creator...

    Hi!!!
    You can see this topic http://forum.sun.com/jive/thread.jspa?threadID=106046
    There is how to call oracle stored procedures. Also I put a lot of links in these topic doing reference stored procedures. I have one that it tells specially how to call oracle stored procedures from java, is in spanish but you can understand the code.;-)
    http://yoprogramador.vampisol.com/index.php?title=pl_sql_oracle_desde_java&more=1&c=1&tb=1&pb=1
    Byeee

  • How to call a sql stored procedure in java...... HELP

    Hi I am making an application for taking backup in sql automatically so i have created a dts package which is called by a stored procedure. Now the problem is that how to call that stored procedure in a Java program so that after running my java program i get my database backup.
    Please please solve my problem.
    thanks in advance.
    If possible please send the code.
    Message was edited by:
    Andy_Davis
    Message was edited by:
    Andy_Davis

    Hi... I am trying to create a dts package which is called by a stored procedure... How can i do this? IF possible can you please send me the code as well..
    Thanks a ton...
    Susan_Davis

  • How to call PL/SQL stored procedure with TWO or more arguments from URL?

    Hi all,
    does anybody know, how to call stored procedure with more than one argument?
    How to do this with one argument is known -
    <img src="#OWNER#.retreive_img_data?i_id=#IMG_ID#" width="70" height="80" alt="No Picture">
    But if I need to call procedure with two formal parameters? And need to pass through URL, for example, two page item values?

    Just separate with an "&". Using your previous example, I'll add i_name and i_type:
    <img src="#OWNER#.retreive_img_data?i_id=#IMG_ID#&i_name=somename&i_type=jpg" width="70" height="80" alt="No Picture" />
    Tyler

  • How to call pl sql stored procedure or function in OAF 10 plus versions

    Hello All,
    I am using J-dev 10.1.3.3.0.3 version.I want to call stored procedure from package in one of my controller. I tried using "txn.createCallableStatement" but it is saying that createcallablemethod is not available.Does any one knows about this.
    Thanks

    Try the OA Framework Forum.
    John

  • How to bind arrays to PL/SQL stored procedure using OCI?

    Hi,
    We are having problems trying to bind arrays to PL/SQL stored procedure using OCI. Here is the situation:
    - We have a stored procedure called "GetVEPFindTasks" with the following interface:
    PROCEDURE GetVEPFindTasks (
    p_ErrorCode OUT NUMBER,
    p_ErrorMsg OUT VARCHAR2,
    p_RowCount OUT NUMBER,
    p_VEPFindTasks OUT t_VEPFindTaskRecordTable,
    p_MaxTask IN NUMBER);
    t_VEPFindTaskRecordTable is a record with the following entries:
    TYPE t_VEPFindTaskRecord IS RECORD (
    RTCID NUMBER,
    TransNum NUMBER,
    TransTimestamp VARCHAR2(20),
    Pathname1 image_data.pathname%TYPE,
    Pathname2 image_data.pathname%TYPE,
    Pathname3 image_data.pathname%TYPE,
    OperatorID operator.id%TYPE);
    - Now, we are trying to call the stored procedure from C++ using OCI (in UNIX). The call that we use are: OCIBindByName and OCIBindArrayOfStruct to bind the parameters to the corresponding buffers. We bind all parameters in the interface by name. Now, we do bind the record's individual item by name (RTCID, TransNum, etc.), and not as a record. I don't know if this is going to work. Then, we use the bind handles of the binded record items (only record items such as RTCID, TransNum, and NOT error_code which is not part of the record) to bind the arrays (using OCIBindArrayOfStruct).
    All of the parameters that are binded as arrays are OUTPUT parameters. The rest are either INPUT or INPUT/OUTPUT parameters. Now, when we try to execute, OCI returns with an error "Invalid number or types of arguments" (or something to that sort... the number was something like ORA-06550). Please help...
    Is there any sample on how to use the OCIBindArrayOfStruct with PL/SQL stored procedures? The sample provided from Oracle is only for a straight SQL statement.
    Thank's for all your help.
    ** Dannil Chan **

    As you said:
    You have to pass in an array for every field and deconstruct/construct the record in the procedure. There is no support for record type or an array of records. Can you give me a example? I'am very urgently need it.
    thanks
    email: [email protected]

  • Calling PL/SQL stored procedure from JSP tag

    Hello,
    I need to call a PL/SQL procedure from a JSP tag , I donot want to use any Bean to call the PL/SQL procedure. How would I call PL/SQL stored procedure from within JSP using JSP tag library, need some code.
    Thank you
    Syed

    need to call a PL/SQL procedure from a JSP tag , I donot want to use any Bean to call the PL/SQL procedure. How would I call PL/SQL stored procedure from within JSP using JSP tag library, need some code.
    regards
    Indira Rani Bandi

  • Calling an Oracle stored procedure using Toplink API - Please help

    Hi,
    We are evaluating Toplink as a possible data access layer in large service-oriented application. The ability to call db stored procedures from within business object layer is crucial for our architechture.
    I am trying to follow toplink application developer's guide examples on how to call stored procedures using toplink.
    I have the folling java code:
    call.setProcedureName("PR_ROMAN_TEST");
    call.addNamedArgument("IN_PARAM");
    call.addNamedOutputArgument("OUT_PARAM");
    ValueReadQuery query = new ValueReadQuery();
    query.setCall(call);
    query.addArgument("IN_PARAM");
    Vector params = new Vector();
    params.addElement(new Integer(5));
    Number result = (Number) session.executeQuery(query, params);
    This generates the following SQL statement:
    BEGIN PR_ROMAN_TEST(IN_PARAM=>5, OUT_PARAM=>?); END;
    An attempt to execute it causes a
    java.sql.SQLException: Invalid column index.
    As I understand it, this exception is thrown because of the "?" in place of the out-parameter value holder.
    The SQL statement that I would want toplink to generate and execute should look like:
    DECLARE result number; BEGIN PR_ROMAN_TEST(IN_PARAM=>5, OUT_PARAM=>result); END;
    , but how do I achieve it and how do I capture the return value, all using toplink api?
    Please help
    Thank you in advance,
    Roman

    I read the conversation above. I am running into a similar kind of problem. I get the following error.
    <an exponent (**)> <> or != or ~= >= <= <> and or like between || The symbol "." was subs Error Code: 6550Local Exception Stack: Exception [TOPLINK-4002] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseException Exception Description: java.sql.SQLException: ORA-06550: line 1, column 38: PLS-00103: Encountered the symbol "NAME" when expecting one of the following:. ( ) , * @ % &' | = - + < / > at in is mod not range rem =>.. <an exponent (**)> <> or != or ~= >= <= <> and or like as between from using || The symbol "." was substituted for "NAME" to continue.ORA-06550: line 1, column 55: PLS-00103: Encountered the symbol "ID" when expecting one of the following:. ( ) , * @ % &' | = - + < / > at in is mod not range rem =>.. <an exponent (**)> <> or != or ~= >= <= <> and or like between || The symbol "." was subs Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 38:PLS-00103: Encountered the symbol "NAME" when expecting one of the following . ( ) , * @ % &' | = - + < / > at in is mod not range rem =>.. <an exponent (**)> <> or != or ~= >= <= <> and or like as between from using || The symbol "." was substituted for "NAME" to continue.ORA-06550: line 1, column 55:PLS-00103: Encountered the symbol "ID" when expecting one of the following: . ( ) , * @ % &' | = - + < / > at in is mod not range rem =>.. <an exponent (**)> <> or != or ~= >= <= <> and or like between || The symbol "." was subs Error Code: 6550 at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:227)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:733)
    at oracle.toplink.internal.databaseaccess.DatabasePlatform.executeStoredProcedureCall(DatabasePlatform.java:1605)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:649)
    at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:506)at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:131)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:115)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelectCall(CallQueryMechanism.java:194)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelect(CallQueryMechanism.java:175)
    at oracle.toplink.queryframework.DirectReadQuery.executeNonCursor(DirectReadQuery.java:65)
    at oracle.toplink.queryframework.DataReadQuery.execute(DataReadQuery.java:73)
    at oracle.toplink.queryframework.ValueReadQuery.execute(ValueReadQuery.java:59)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:493)
    at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:125)
    at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1958)
    at oracle.toplink.threetier.ServerSession.internalExecuteQuery(ServerSession.java:629)
    at oracle.toplink.threetier.ClientSession.internalExecuteQuery(ClientSession.java:392)
    at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086)
    at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2246)
    at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086)
    at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1055)
    at com.eplinc.common.persistence.toplink.TopLinkTemplate$2.readFromSession(TopLinkTemplate.java:181)
    at com.eplinc.common.persistence.toplink.SessionReadCallback.doInTopLink(SessionReadCallback.java:59)
    at com.eplinc.common.persistence.toplink.TopLinkTemplate.execute(TopLinkTemplate.java:110)
    at com.eplinc.common.persistence.toplink.TopLinkTemplate.executeQuery(TopLinkTemplate.java:178)
    at com.eplinc.common.persistence.toplink.TopLinkTemplate.executeQuery(TopLinkTemplate.java:172)
    at com.epl.outletteller.dao.toplink.TopLinkOIDGeneratorDAO.generateId(TopLinkOIDGeneratorDAO.java:45)
    The call I am making is as follows :
    public long generateId(String name, long outletId) throws DataAccessException {
    TopLinkTemplate tlTemplate = new TopLinkTemplate();
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("AUTONUM.GET_NEXT_VALUE");
    call.addNamedArgument("autonum name");
    call.addNamedArgument("outlet id");
    call.addNamedOutputArgument("OUTPUT_1");
    ValueReadQuery query = new ValueReadQuery();
    query.setCall(call);
    query.addArgument("autonum name");
    query.addArgument("outlet id");
    Object[] parameters = new Object[2];
    parameters[0] = name;
    parameters[1] = Long.toString(outletId);
    Number uniqueNumber = (Number)tlTemplate.executeQuery(query,parameters);
    return uniqueNumber.longValue();
    This is my Table AUTONUM_SETTING
    AUTONUM_NAME AUTONUM_TYPE START_VAL END_VAL INCREMENT_VALUE
    TRAN_NUM GLOBAL 1 999999 1
    TRACE_NUM OUTLET 1 999999 1
    Any help would be appreciated. Thanks

  • Button to call pl/sql stored proc using text box value as parameter

    I need to create a portal page with an input text box and a button (or a clickable pl/sql item). A user will enter a value in the text box and click the button, a stored pl/sql procedure will be executed that takes the value of the text box as an input parameter. The procedure output (basically a success or an error message) must be printed in a new window which the user can close after checking the output. No redirection to another page is required.
    I have no experience in developing portal pages and would appreciate if you point me in a right direction. Do I need to create an html form and obtain the value of the text box via p_session object? In this case what do I need to specify as ACTION for the form - the same page URL? Where should I place the call to the stored procedure? Or can I somehow use a pl/sql item?
    Thank you for your help

    Hi Arnaud
    Thank you for the reply. Could you please give me dome more details. I have created a procedure:
    create or replace procedure grant_roles (p_username varchar2) as
    begin
    <code>
    htp.p('Grant succeeded for username is '||p_username);
    exceptions when others then
    htp.p('Grant failed. '||v_err_msg);
    end;
    and an html portlet:
    <html>
    <body>
    <form name="input" action="/pls/portal/pls/portal_public.grant_roles_test?p_username=anna" method="get">
    <input type="text" name="t_username" size="20">
    <br>
    <input type="submit" value="Grant">
    </form>
    </body>
    </html>
    Obviously this is not the right way to call my procedure as it does not work. And of course I want to pass the value of the t_username text box to the procedure not the string "anna". I am also not sure where a procedure prints its output. Is it possible to open a new window to display the output?
    Thank you for your help,
    Anna

  • Error calling PL/SQL stored procedure

    Hi,
    I'm pretty new to JDeveloper having used NetBeans for the last few years.
    I'm getting an error when trying to call a PL/SQL stored procedure. When I click on any of the oracle errors I get an "unable to find source file" message. The errors occurs in call.execute(). The error message and Java code are listed below. Any help is much appreciated.
    Cheers,
    Stevie
    Errors:
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 33
         at java.lang.String.charAt(String.java:558)
         at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:877)
         at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:811)
         at oracle.jdbc.driver.OracleSql.getSql(OracleSql.java:284)
         at oracle.jdbc.driver.OracleSql.getSqlBytes(OracleSql.java:538)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:169)
         at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:873)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1161)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3093)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4286)
         at oracle.CallPLSQL.callLMO(CallPLSQL.java:118)
         at oracle.TestHarness.main(TestHarness.java:18)
    Jave Code:
    package oracle;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Types;
    public class CallPLSQL {
    private Connection conn;
    public CallPLSQL() {
    *Constructor.
    try {
    //Register Oracle Database Drive
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //set connection
    String connectionString="jdbc:oracle:thin:TSD/TSD@DEV:1526:DEVELOP";
    this.setConn(DriverManager.getConnection(connectionString,"TSD", "TSD"));
    } catch (SQLException ex) {
    public int callproc () throws SQLException {
    CallableStatement call;
    String callString = "{call proc" +
    call = conn.prepareCall(callString);
    call.setInt(1, 120289);
    call.setInt(2, 2008);
    call.registerOutParameter(3, Types.INTEGER);
    call.registerOutParameter(4, Types.INTEGER);
    call.registerOutParameter(5, Types.INTEGER);
    call.registerOutParameter(6, Types.DATE);
    call.registerOutParameter(7, Types.VARCHAR);
    call.registerOutParameter(8, Types.INTEGER);
    call.registerOutParameter(9, Types.INTEGER);
    call.execute();
    int i = call.getInt("app_id");
    return i;
    public void setConn(Connection conn) {
    this.conn = conn;
    public Connection getConn() {
    return conn;
    }

    I've fixed it now. I'd missed a } in prepareCall. What a doughball.

  • Calling PL/Sql Stored Procedure from java file

    Having problem in calling oracle stored procedure using bc4j.

    in ApplicationModuleImpl you can use following e.g.
    on client side use a custom method to access
    try {
    DBTransaction dBTransaction = getDBTransaction();
    String stmt = "CALL CHANGE_OWNER( ?, ?)";
    CallableStatement callableStatement = dBTransaction.createCallableStatement(stmt,DBTransaction.DEFAULT);
    callableStatement.setString( 1, oldOwner );
    callableStatement.setString( 2, newOwner );
    callableStatement.execute();
    } catch (SQLException ex) {
    throw new JboException(ex);
    }

  • Calling ORACLE/SQL stored procedure...

    Hello,
    Is it possible to invoke non-parametrized Stored Procedures (a procedure that, neither having IN parameter nor OUT parameter) from BizTalk.?
    Any suggestion/solution?
    Thanks,
    Prajakt.
    Praj Dixit

    Praj,
    Yes possible.
    Create a .NET helper which will call the stored procedure and handle the return value/recordset from sp and in your BizTalk artifacts call this .NET helper/wrapper to SQL stored procedure. 
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How to customize events, execute stored procedures using JSF and ADF BC

    As a java beginner, I started with developing simple web application using JSF and ADF business component through visual and declarative approach. I need to know how to customize events, execute stored procedures, invoke functions on triggering events associated with rich controls. for eg. how to write customized functions on button click or checkbox click events to achieve business requirement and can be modified whenever required.
    Edited by: 792068 on Aug 31, 2010 9:40 PM

    Which business layer is prefered to create interactive data model: 1. ADF business components or 2. Enterprise JavaBeans using Java persistance API (JPA) or 3. Toplink 4. Portlets
    which minimizes writing low level codes and how much OOPS knowledge is required for creating above business layer binding data to viewcontroller layer?

  • Calling SQL Stored Procedure using Oracle Gateway

    Hi
    Do you know how i can call a stored procedure with parameters from Oracle using oracle gateway?

    Don't know which gateway you are using. Only the transparent gateway for SQL Server and Sybase that have support for stored procedures.
    Take a look at case 7 which shows how to do this.
    Rem case7.sql
    Rem
    Rem Copyright (c) Oracle Corporation 2000. All Rights Reserved.
    Rem
    Rem NAME
    Rem case7.sql
    Rem
    Rem DESCRIPTION
    Rem SQL script which executes the demo case7 for the
    Rem Transparent Gateways
    Rem
    Rem NOTES
    Rem The database link GTWLINK should be created before you can
    Rem run this demo file
    Rem
    Rem MODIFIED (MM/DD/YY)
    Rem kpeyetti 11/09/00 - Created
    Rem
    SET ECHO ON
    DROP TABLE LOCAL_GTW_DEPT;
    CREATE TABLE LOCAL_GTW_DEPT (DEPTNO INTEGER, DEPTNAME VARCHAR2(14));
    SELECT * FROM LOCAL_GTW_DEPT;
    DECLARE
    DNAME VARCHAR2(14);
    BEGIN
    "GetDept"@GTWLINK(10,DNAME);
    INSERT INTO LOCAL_GTW_DEPT VALUES (10, DNAME);
    END;
    SELECT * FROM LOCAL_GTW_DEPT;

Maybe you are looking for

  • Did New Pages 5.0 for Mac allow bookmarks?

    I have several document that in the footer i had wrote a link pointing to my table of contents. But when I upgraded to MacOS Mavericks my documents now are a completely mess and i lost images inside tables (i used tables to put an images and caption

  • Why is my macbook pro running slow since ive upgraded to yosemite?

    EtreCheck version: 2.1.8 (121) Report generated March 19, 2015 at 11:45:45 PM PDT Download EtreCheck from http://etresoft.com/etrecheck Click the [Click for support] links for help with non-Apple products. Click the [Click for details] links for more

  • Is there an add on thunderbolt port available for older mac pro

    I would like to purchase the Promise Pegasus 12 TB raid 6 storage system for my 2009/2010 mac pro, but it requires a thunderbolt cable.  From what I can see my mac pro doesn't have a thunderbolt port. 

  • V_T7XSSPERBIZFLC doesnt influence portal Biz card view

    I am trying to show IT0009-ZLSCH on biz card view on Bank Details overview screen at ESS. I maintained entry at V_T7XSSPERBIZFLC but still it doesnt have any impact. 1. I tried to see where the underlying table of this view(T7XSSPERBIZFLDC) is being

  • IE vs Chrome Menu bar Problems

    After nearly completing my home page I was told I needed drop down menus, so i changed it from a regular menu bar to one with a few drop downs, and once again ran into problems with chrome vs ie, chrome looks pretty good IE messes it all up, anyone w