SQLException Calling Stored Procedure

Hello all,
I'm getting the following exception when calling a stored procedure from Java. Maybe someone can help me out here. See details below.
Exception
java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)
at storedproctest.StoredProcApp.<init>(StoredProcApp.java:111)
at storedproctest.DBApp.<init>(DBApp.java:20)
at storedproctest.DBApp.main(DBApp.java:49)
Database - Oracle 9.2.0.1.
SQL> desc dsl_type;
Name Null? Type
SITE_NAME VARCHAR2(30)
DSL_ID NUMBER(10)
DSL_NAME VARCHAR2(20)
THRESHOLD NUMBER
AZIMUTH NUMBER
SIG_DWN_COL_DURATION NUMBER
COMMENTS VARCHAR2(100)
CREATED_BY_ID NUMBER(5)
DATE_CREATED DATE
LAST_MODIFIED_BY_ID NUMBER(5)
DATE_LAST_MODIFIED DATE
DATE_DEACTIVATED DATE
SQL>
SQL> desc dsls;
Name Null? Type
SITE_NAME NOT NULL VARCHAR2(30)
DSL_ID NOT NULL NUMBER(10)
DSL_NAME NOT NULL VARCHAR2(20)
THRESHOLD NOT NULL NUMBER
AZIMUTH NOT NULL NUMBER
SIG_DWN_COL_DURATION NOT NULL NUMBER
COMMENTS NOT NULL VARCHAR2(100)
CREATED_BY_ID NOT NULL NUMBER(5)
DATE_CREATED NOT NULL DATE
LAST_MODIFIED_BY_ID NOT NULL NUMBER(5)
DATE_LAST_MODIFIED NOT NULL DATE
DATE_DEACTIVATED DATE
SQL>
pl/SQL procedure
PROCEDURE add( dslIn IN DSL_TYPE )
AS
dslId NUMBER := 0;
BEGIN
-- Do a little sanity checking
utils.assert_non_zero( dslIn.created_by_id );
utils.assert_not_null( dslIn.dsl_name );
-- Get a new sequence value and insert the new dsl
SELECT dsls_id_seq.NEXTVAL INTO dslId FROM dual;
INSERT INTO dsls( SITE_NAME, DSL_ID, DSL_NAME, THRESHOLD, AZIMUTH, SIG_DWN_COL_DURATION, COMMENTS,
CREATED_BY_ID, DATE_CREATED, LAST_MODIFIED_BY_ID, DATE_LAST_MODIFIED, DATE_DEACTIVATED )
VALUES(( SELECT TRIM( global_name ) FROM global_name ), dslId, dslIn.dsl_name, dslIn.threshold,
dslIn.azimuth, dslIn.sig_Dwn_Col_Duration, dslIn.comments, dslIn.created_by_id, SYSDATE,
dslIn.created_by_id, SYSDATE, NULL );
-- Commit this transaction to the database
COMMIT;
END add;
Java code
try {
StructDescriptor dslStructDesc = StructDescriptor.createDescriptor( "DSL_TYPE", dbConn );
Object[] dslAttributes = new Object[12];
dslAttributes[0] = " "; // populated via pl/sql
dslAttributes[1] = new BigDecimal( 0 ); // populated via pl/sql
dslAttributes[2] = "Crator Lake";
dslAttributes[3] = new BigDecimal( 098.34 );
dslAttributes[4] = new BigDecimal( 23.67 );
dslAttributes[5] = new BigDecimal( 101.1 );
dslAttributes[6] = "Inserting from JAVA!";
dslAttributes[7] = new BigDecimal( 2 );
dslAttributes[8] = new java.sql.Date( GregorianCalendar.getInstance().getTimeInMillis());
dslAttributes[9] = new BigDecimal( 2 );
dslAttributes[10] = new java.sql.Date( GregorianCalendar.getInstance().getTimeInMillis());
dslAttributes[11] = new java.sql.Date( GregorianCalendar.getInstance().getTimeInMillis());
STRUCT dslType = new STRUCT( dslStructDesc, dbConn, dslAttributes );
ocStmnt = (OracleCallableStatement)dbConn.prepareCall( "CALL DSL.add( ? )" );
ocStmnt.setObject( 1, dslType );
ocStmnt.execute();
ocStmnt.close();
dbConn.close();
catch( SQLException sqlEx ) { sqlEx.printStackTrace(); }

I'm not necessarily recommending the approach, but you can use a SELECT in the VALUES clause.
It acts as a scalar subquery, so it will work in 8i and up in SQL, and 9i and up in PL/SQL.
It will also work in PL/SQL in 8i if you use dynamic SQL.
65765, use the code tags to format your code.
I ran this in 9.2.0.4.
INSERT INTO t
        id,
        value
VALUES
        1,
        (SELECT ROWNUM FROM all_objects WHERE ROWNUM = 1)
1 row created.
SELECT * FROM t
        ID      VALUE
         1          1
BEGIN
        INSERT INTO t
                id,
                value
        VALUES
                2,
                (SELECT ROWNUM FROM all_objects WHERE ROWNUM = 1)
END;
PL/SQL procedure successfully completed.
SELECT * FROM t
        ID      VALUE
         1          1
         2          1

Similar Messages

  • SQLException Calling Stored Procedure with Date OUT Parameters

    Hi,
    I'm trying to call a stored procedure in Oracle 10.1.0.4 using JDBC driver version 10.1.0.5. Here is the Stored procedure I'm trying to call:
    CREATE OR REPLACE PROCEDURE get_collector_segment_info (
    cid IN eb_collector_segment_iot.collector_id%TYPE,
    cnum IN eb_collector_segment_iot.collector_num%TYPE,
    sct OUT NOCOPY coll_seginfo_segment_codes,
    snt OUT NOCOPY coll_seginfo_segment_names,
    st OUT NOCOPY coll_seginfo_statuss,
    sdt OUT NOCOPY coll_seginfo_start_dates,
    edt OUT NOCOPY coll_seginfo_end_dates
    AS
    coll_id eb_collector_segment_iot.collector_id%TYPE;
    err_msg VARCHAR2 (1000);
    BEGIN
    -- Check if collector_id is present. If not, get the collector ID using collector Num
    IF cid IS NULL
    THEN
    coll_id := eb_collector_segment_get_cid (cnum, err_msg);
    IF err_msg IS NOT NULL
    THEN
    raise_application_error
    (-20001,
    'Error while getting Collector ID for Collector Num: '
    || cnum
    || ', Msg: '
    || err_msg
    END IF;
    ELSE
    coll_id := cid;
    END IF;
    -- Return the Segments
    SELECT ecs.segment_code, es.segment_name, es.status, ecs.start_date,
    ecs.end_date
    BULK COLLECT INTO sct, snt, st, sdt,
    edt
    FROM eb_collector_segment ecs, eb_segment es
    WHERE ecs.collector_id = coll_id
    AND ecs.segment_code = es.segment_code
    AND es.status = '1';
    IF SQL%ROWCOUNT = 0
    THEN
    raise_application_error
    (-20002,
    'No Segment records found for Collector ID: '
    || coll_id
    END IF;
    END get_collector_segment_info;
    ecs.segment_code, es.segment_name and es.status are of type VARCAHR2 and ecs.start_date and ecs.end_date are of type DATE. I wrote the following code to call the above store procedure:
    connection = this.datasource.getConnection();
    oracleCallableStatement = (OracleCallableStatement) connection.prepareCall("begin " + STORED_PROCEDURE_NAME
    + "(?, ?, ?, ?, ?, ?, ?); end;");
    oracleCallableStatement.setNull("cid", Types.VARCHAR);
    oracleCallableStatement.setLong("cnum", collectorNum);
    oracleCallableStatement.registerIndexTableOutParameter(3, 100, OracleTypes.VARCHAR, 100);
    oracleCallableStatement.registerIndexTableOutParameter(4, 100, OracleTypes.VARCHAR, 100);
    oracleCallableStatement.registerIndexTableOutParameter(5, 100, OracleTypes.VARCHAR, 100);
    oracleCallableStatement.registerIndexTableOutParameter(6, 100, OracleTypes.DATE, 0);
    oracleCallableStatement.registerIndexTableOutParameter(7, 100, OracleTypes.DATE, 0);
    resultSet = oracleCallableStatement.executeQuery();
    When I run the code, I get a "java.sql.SQLException: Invalid PL/SQL Index Table" exception on oracleCallableStatement.executeQuery(). I tried many other variations and searched on forums but nothing worked for me. Does anyone have any idea? I'm really desparate. i use JDK 1.4.2_12 and WebLogic 8.1 SP6.
    Thanks,
    Zhubin
    Message was edited by:
    zhoozhoo
    Message was edited by:
    zhoozhoo

    Hi Avi,
    I think you are right and I was using the wrong method. With some help from our DBA the problem was resolved Here is the correct code:
    connection = this.datasource.getConnection();
    oracleCallableStatement = (OracleCallableStatement) connection.prepareCall("begin " + STORED_PROCEDURE_NAME
    + "(?, ?, ?, ?, ?, ?, ?); end;");
    oracleCallableStatement.setNull(1, Types.VARCHAR);
    oracleCallableStatement.setLong(2, collectorNum);
    oracleCallableStatement.registerOutParameter(3, OracleTypes.ARRAY, "COLL_SEGINFO_SEGMENT_CODES");
    oracleCallableStatement.registerOutParameter(4, OracleTypes.ARRAY, "COLL_SEGINFO_SEGMENT_NAMES");
    oracleCallableStatement.registerOutParameter(5, OracleTypes.ARRAY, "COLL_SEGINFO_STATUSS");
    oracleCallableStatement.registerOutParameter(6, OracleTypes.ARRAY, "COLL_SEGINFO_START_DATES");
    oracleCallableStatement.registerOutParameter(7, OracleTypes.ARRAY, "COLL_SEGINFO_END_DATES");
    oracleCallableStatement.execute();
    String[] segmentCodes = (String[]) oracleCallableStatement.getARRAY(3).getArray();
    String[] segmentNumbers = (String[]) oracleCallableStatement.getARRAY(4).getArray();
    String[] segmentStatuses = (String[]) oracleCallableStatement.getARRAY(5).getArray();
    Timestamp[] startDates = (Timestamp[]) oracleCallableStatement.getARRAY(6).getArray();
    Timestamp[] endDates = (Timestamp[]) oracleCallableStatement.getARRAY(7).getArray();
    segments = new Segment[segmentCodes.length];
    for (int i = 0; i < segmentCodes.length; i++) {
    System.out.println(segmentCodes[i] + ' ' + segmentNumbers[i] + ' ' + segmentStatuses[i] + ' ' + startDates[i] + ' '
    + endDates);
    segments[i] = new Segment();
    segments[i].setSegmentCode(segmentCodes[i]);
    segments[i].setSegmentName(segmentNumbers[i]);
    segments[i].setStatus(segmentStatuses[i]);
    if (startDates[i] != null) {
    segments[i].setStartDate(new java.util.Date(startDates[i].getTime()));
    if (endDates[i] != null) {
    segments[i].setEndDate(new java.util.Date(endDates[i].getTime()));
    Thanks,
    Zhubin

  • Calling stored procedure in OCCI

    Hi, Guys.
    I triy to call stored procedure in Oracle database server.But i have problems with taking of the OUT parameters.
    How to call the procedure corectly?
    Depend on Oracle manual everything is fine but as we see that is not.
    Here is the 2 lines that make the problem.
    statement->registerOutParam(2, Type::OCCIINT, sizeof ( if_false ) );
    statement->registerOutParam(3, Type::OCCIString, sizeof ( __result ) );
    I can't access Type::OCCIINT and Type::OCCIString.
    I tried and Type::OCCISTRING but without any result.
    Can you help me?
    This is the all code i use:
    Environment *env = Environment::createEnvironment ( Environment::DEFAULT );
    Connection *conn = env->createConnection ( user, pass, osid );
    Statement * statement = conn->createStatement ( query );
    ResultSet * result = statement->executeQuery ( query );
    result->setCharacterStreamMode ( 2, 10000 );
    statement->setSQL ( "BEGIN tracetst.get_tst_moduls ( :1, :2, :3 ); END:" );
    int if_false;
    string __result;
    statement->setString ( 1, "116714020010" );
    statement->registerOutParam(2, Type::OCCIINT, sizeof ( if_false ) );
    statement->registerOutParam(3, Type::OCCIString, sizeof ( __result ) );
    statement->executeUpdate();
    if_false = statement->getInt (2);
    /* Set the 1,2 args into err_result and modules. The action is only with these */
    err_result = if_false;
    __result = statement->getString (3);
    cout << if_false;
    cout << __result;
    //printf ( result );
    //statement->executeUpdate ( query );
    env->terminateConnection ( conn );
    Environment :: terminateEnvironment ( env );
    While compiling I have an error message.Here it is :
    trace.cpp: In member function `const char* oracle_io::get_data()':
    trace.cpp:668: error: `oracle::occi::Type' is not an aggregate type
    Tha is the line adn the next line is same :
    statement->registerOutParam(2, Type::OCCIINT, sizeof ( if_false ) );
    statement->registerOutParam(3, Type::OCCIString, sizeof ( __result ) );
    How to call the procedure corectly?
    Depend on Oracle manual everything is fine but as we see that is not.
    Thanks in advance.
    P.S. I would like to thanks to Amogh for helping me before.

    Did you remove the colon after END ?
            Environment *env = Environment::createEnvironment(Environment::OBJECT);
            Connection *conn = env->createConnection("scott","tiger","inst1");
            Statement *stmt;
            int num; string name;
            try
                    stmt=conn->createStatement();
                    stmt->setSQL ( "BEGIN scott.test ( :1, :2, :3 ); END;" );
                    stmt->setString ( 1, "11" );
                    stmt->registerOutParam(2, OCCIINT,sizeof(num));
                    stmt->registerOutParam(3, OCCISTRING,sizeof(name));
                    stmt->execute();
                    num=stmt->getInt(2); name=stmt->getString(3);
                    cout<<num<<"   "<<name<<endl;
            catch (SQLException &ex)
                    env->terminateConnection(conn);
                    Environment::terminateEnvironment(env);
                    cout<<ex.getMessage();
            env->terminateConnection(conn);
            Environment::terminateEnvironment(env);
    ...Rgds.
    Amogh

  • DB adapter calling stored procedure and change database schema

    Hello,
    when I create DB adapter which call stored procedure I find that is reference to DB schema in JCA file. Other DB adapter operation (select, insert, delete) store only connection-factory location.
    What happend when I move procedure to another DB schema or rename DB schema?
    It is only about change SchemaName in JCA file?
    Thank you.

    It sounds excelent.
    I try it. Change JCA file and redeploy SCA of service.
    Next I change user in data source (password is the same for both schemas). Save and activate changes. Update deployment of DBAdapter.
    Select operation on service works but return data from old schema.
    Call stored procedure fail with exception:
    oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'delete' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the NEW_SCHEMA.PKG_UTILS.SERVICE_REMOVE API. An error occurred while preparing and executing the NEW_SCHEMA.PKG_UTILS.SERVICE_REMOVE API. Cause: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'NEW_SCHEMA.PKG_UTILS' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Check to ensure that the API is defined in the database and that the parameters match the signature of the API. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-6550" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception.

  • How to call stored procedures from java program?

    I have tried to run a program that calls a stored procedure on MySQL
    server version 5.0.17 by using connector/j 5.0, but it always fails on the
    statement: con.preparecall() ,
    have looked on the internet and found out that people can all mysql
    stored procedure all right in their programs, really dont know what's
    wrong with this small peiece of code:
    import java.sql.*;
    public class TestDB {
          // procedure being called is:
         CREATE PROCEDURE `dbsaystorm`.`getsite` ()
         BEGIN
            select  name  from tblsite;
         END
         public static void main(String[] args) {
              try  {
                  //Class.forName("org.gjt.mm.mysql.Driver");
                  Class.forName("com.mysql.jdbc.Driver");
                  Connection con = DriverManager.getConnection("jdbc:mysql://localhost/dbname",
                            "user", "pwd");
           * executing SQL statement here gives perfect correct results:
            // PreparedStatement ps = con.prepareStatement("select name from tblsite");      
            // ResultSet rs =ps.executeQuery();
                  // but in stored procedure way...
                  //it fails here on this prepare call statement:             
                  CallableStatement proc = con.prepareCall("call getsite()");
                  ResultSet rs =proc.executeQuery();                      
                  if (rs == null) return;                                      
                  while (rs.next()){                 
                      System.out.println("site name is: "+ rs.getString(1));                                
                  rs.close();
              } catch (SQLException e) {e.printStackTrace();}
               catch (Exception e) {e.printStackTrace();}         
    }it always gives this exception:
    java.lang.NullPointerException
         at com.mysql.jdbc.StringUtils.indexOfIgnoreCaseRespectQuotes(StringUtils.java:959)
         at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1280)
         at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:3668)
         at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:638)
         at com.mysql.jdbc.CallableStatement.<init>(CallableStatement.java:453)
         at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4365)
         at com.mysql.jdbc.Connection.prepareCall(Connection.java:4439)
         at com.mysql.jdbc.Connection.prepareCall(Connection.java:4413)
         at saystorm.server.data.database.TestDB.main(TestDB.java:29)
    where have I gone wrong?
    when I commented out the statement that makes the procedure call and call preparedstatement to execute SQL select statement, it gave perfectly correct result.
    it looks like there is no problem with java prog accessing MYSQL server database, but the it seems that it's just java can't call stored procedure stored on the mysql server version 5.
    can it or can't it? if it can, how is that accomplished?

    It is a bug in the driver because it shouldn't be
    returning that exception (null pointer) even if you
    are doing something wrong.
    Are you using the latest version of the driver?
    The stored procedure runs when you run it from the
    gui/command line using a MySQL tool - correct?
    As suggested you should be using the brackets. What
    is the data type of the 'name' field?
    You could try returning another value like one of the
    following
    select 1, name from tblsite;
    select name, 1 from tblsite;
    That might get around the bug
    Additionally try just the following...
    select 'test' from tblsite;yes, the driver used is in connector/j 5.0--the lastest one, and the
    procedure can run correctedly at either command line or GUI mode
    with no problem whatsoever, the returned data type is string type,
    I have not got the chance to test it again with those values you
    suggested, as I have abandoned the laptop I used to write that code
    initately. There have been some other really weird cases happened on
    that computer. I guess that must be something wrong with the JVM
    installed on it, it was upgraded from jre5.0.04 to 06, and to 09.
    something within hte JVM must have been messed up(the only reasonable
    explanation). Because the same code runs correctly on my new laptop,
    using the same environment: jvm 5.0_09, mysql 5.0.18, connector/J 5.0.
    that old laptop really was a nightmare.

  • Need sample source code for calling stored procedure in Oracle

    Hi.
    I try to call stored procedure in oracle using JCA JDBC.
    Anybody have sample source code for that ?
    Regards, Arnold.

    Thank you very much for a very quick reply. It worked, but I have an extended problem for which I would like to have a solution. Thank you very much in advance for your help. The problem is described below.
    I have the Procedure defined as below in the SFCS1 package body
    Procedure Company_Selection(O_Cursor IN OUT T_Cursor)
    BEGIN
    Open O_Cursor FOR
    SELECT CompanyId, CompanyName
    FROM Company
    WHERE CompanyProvince IN ('AL','AK');
    END Company_Selection;
    In the Oracle Forms, I have a datablock based on the above stored procedure. When I execute the form and from the menu if I click on Execute Query the data block gets filled up with data (The datablock is configured to display 10 items as a tabular form).
    At this point in time, I want to automate the process of displaying the data, hence I created a button and from there I want to call this stored procedure. So, in the button trigger I have the following statements
    DECLARE
    A SFCS1.T_Cursor;
    BEGIN
    SFCS1.Company_Selection(A);
    go_Block ('Block36');
    The cursor goes to the corresponding block, but does not display any data. Can you tell me how to get the data displayed. In the future versions, I'm planning to put variables in the WHERE clause.

  • Call stored procedure with OUT parameter

    Hello,
    I have created a short-lived process. Within this process I am using the "FOUNDATION > JDBC > Call Stored Procedure" operation to call an Oracle procedure. This procedure has 3 parameters, 2 IN and 1 OUT parameter.
    The procedure is being executed correctly. Both IN parameters receive the correct values but I am unable to get the OUT parameter's value in my process.
    Rewriting the procedure as a function gives me an ORA-01460 since one of the parameters contains XML (>32K) so this is not option...
    Has someone been able to call a stored procedure with an OUT parameter?
    Regards,
    Nico

    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) {}

  • Creation of DB Adaptert for calling stored procedure in MS SQL server

    Hi,
    I need to create a DB adapter to call a stored procedure in MS SQL Server.
    I have gone thru the thread MS SQL Server database connection
    It mentions that we need to use a command line utility for generating the wsdl and xsd for calling stored procedures in MS SQL server. Please provide information where to find this utility and how to use it.
    Any links to tutorials are welcome.
    Thanks !!.
    Silas.

    Command line is required for stored procedures, if you are using the basic options you don't need to worry.
    (1) Download MS SQL Server 2005 JDBC Driver from Microsoft Site. http://msdn.microsoft.com/en-us/data/aa937724.aspx
    (2) The download is self extracting exe file. Extract this into Program Files on your machine. It should create folder as "Microsoft SQL Server 2005 JDBC Driver"
    (3) In above mentioned folder search for sqljdbc.jar copy this file into JDeveloper\JDBC\lib folder.
    (4) Open JDeveloper/jdev/bin/jdev.conf file add following entry.
    AddJavaLibPath C:/Program files/Microsoft SQL Server 2000 Driver for JDBC/lib
    While executing this step make sure that your JDeveloper is closed.
    (5) On command prompt go to J Developer folder and execute following command
    jdev -verbose
    This will open JDeveloper.
    (6) Now go to JDeveloper > Connections > Database Connections > New Database Connection
    (7) Select Third Party JDBC
    (8) Specify MS Sql Server User Name, password and Role.
    (9) In connection page specify following
    - Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    - For class path browse to C:/Program files/Microsoft SQL Server 2000 Driver for JDBC/lib folder, select sqljdbc.jar add it as library.
    - Specify URL as following.
    jdbc:sqlserver://SERVERNAME:1433;databaseName=MSSQLDBNAME;
    (10) Go to Test page and test it.
    cheers
    James

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • Calling Stored Procedure with OraClob as parameter IN

    I am using Visual C++ and using oo4o the ole way
    I am try to call stored procedure that have Clob as parameter in
    it seems the the OraParameters Add method don't have the ability since it can only receive variantt.
    How do I do it
    Thanks
    Yoav

    fyi
    Related to the solution/workaround posted by Luc.
    see "Do Oracle's JDBC drivers support PL/SQL tables/result sets/records/booleans? "
    at http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#34_05
    regards
    Jan Vervecken

  • Calling Stored Procedure with in Stored Procedure

    I have one stored procedure A, I want to call Stored procedure A from Stored Procedure B and want to give input parameter to Stored Procedure A within Stored Procedure B using while loop.
    i.e I have one stored procedure A which uses Telephone number as input parameter and pull out data
    I want to create one more stored procedure B which will call stored procedure A internally and give telephone number one by one using while loop and push the result in Table C.

    >
    I have one stored procedure A, I want to call Stored procedure A from Stored Procedure B and want to give input parameter to Stored Procedure A within Stored Procedure B using while loop.
    i.e I have one stored procedure A which uses Telephone number as input parameter and pull out data
    I want to create one more stored procedure B which will call stored procedure A internally and give telephone number one by one using while loop and push the result in Table C.
    >
    Doesn't sound a good idea in terms of performance or design. OK, what's your query?
    The concept is:
    create or replace procedure Proc_A (p_phone varchar2)
    is
    Begin
       Insert into Tablec (col1, col2, col3, phone) values (val1, val2, val3, p_phone);
    Exception
      When no_data_found then
       do what...
    End;
    Create or Replace Procedure Proc_B as
    Begin
    For i in (select phone_no from customer)
    Loop
      Proc_A(i.phone_no);
    End Loop;
    End;
    /Once again, I have to say, it's a bad idea. You may well do it within a single procedure or even a single SQL. Tell us your exact requirements and we'll be able to help you
    Edited by: user12035575 on Sep 5, 2011 8:26 PM

  • Calling Stored Procedure without JDBC-Adapter

    Hallo,
    as it is not possible calling Stored Procedures with the parameter Typ Record in Oracle my question: It is possible connecting to DB using native java-code for example in Mapping?
    Thanks in advance,
    Frank

    Hi Frank,
    Maybe you can use the DB look up using the JDBC adapter in your mapping.
    Just check this blog for the same,
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    As for calling an Oracle Strored Procedure, it is possible using a RECEIVER JDBC adapter, but not a SENDER JDBC adapter.
    <i> import the jdbc-driver (oracle) in an archive in Designer.</i>
    Also, this imported archive should be under any Namespace, but, it should be in the same SWCV as the one in which the mapping is being executed.
    Regards,
    Bhavesh

  • CALLING STORED PROCEDURE IN DATABASE FROM FORMS4.5

    Is there any body know how to call stored procedure from Forms 4.5 ?
    I am writing a when-button-pressed trigger.
    Put the stored procedure name on there. But
    it said "stored procedure name is not declared on this scope".
    Thanks a lot
    null

    Try logging in to SQL*Plus and running the procedure, e.g....
    SQL> begin
    database_procedure_name(update_web);
    end;
    If it runs OK there, then it should run from within your form (provided that you are logged in as the same user as the test with SQL*Plus.

  • JDBC-Adapter-Receiver Calling Stored Procedure with Input-Typ Record

    Hallo,
    I´ m trying calling a stored-procedure with two input-parameter; one of typ record (oracle) and one of type tabel of records. Is this possible (I think there are only types like string, integer etc. possible)? When not is there another possibility to work with that type?
    Thanks in advance,
    Frank

    Hi Frank,
    I think stored procedures will not take Array of Records as a Input. If you want to make a loop funtionality etc then JDBC adapter will work accordingly. You need to just call the stored procedure from the JDBC adapter. It will work for the array of records(multiple occurences).
    Receiver JDBC Procedures.
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Alternative option is you can make use of Java Proxy and from there you can call stored procedure ..I think it is possible.. not tried.
    Hope this helps
    Regards,
    Moorthy

  • Calling Stored procedure with Parameters in PowerPivot DataModel

    Hi All,
    I wanted to call a SQL stored procedure from PowerPivot(Excel) on based on changing slicer's value. 
    Currently, we can call stored procedure wihtout any parameter from Data Model tab using 
    Exec stored_proc_name in Table Properties window.
    What if I want to call the same procedure with a parameter whouse value will come by changing slicer's value. I  meant, changing slicer value will act as a parameter to that stored procedure & it should return updated results. 
    Is this possible in PowerPivot?

    Hi Rameshwar,
    According to your description, you call a SQL Server stored procedure in PowerPivot data model, now the problem is that you need to pass a parameter to the stored procedure, right?
    Based on my research, it seems that we cannot achieve this requirement directly in current version of PowerPivot data model. Here is a similar thread for you reference.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5350228d-bc62-4a3b-a1a6-e847483e2858/powerpivot-for-excel-2013-call-execute-stored-procedure-with-parameters?forum=sqlkjpowerpivotforexcel
    If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that they can be, Microsoft might consider to add this feature
    in the following release after official confirmation.
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • Streaming video on youTube

    My neighbor gave me an eMac for my 9 yr old daughter to use. I upgraded it to OS 10.4.11 and it works fine except for watching streaming videos. Both Quicktime and Flash stutter in Safari, but since I've reinstalled Quicktime it works only on Firefox

  • Material to be recieved from vendor

    Dear All, we have four plants 001,002,003 & 004. 001 & 002 will send the material to vendor with 541 movement type. 004 will raise an subcon PO to vendor say 555.then when i recieve the material in 004 plant the raw material provided from 001 & 002 s

  • A Way to convert from PAGES to PDF?

    Is this possible? Can anybody tell me how? Thanks.

  • Problems with the Search for room content

    Hi, I face a problem configuring the search for room content using KM search iView (com.sap.km.Search). I found the chapter Configuring the Search for Room Content in the help. So I set up the following things : 1- I assign the room_id iView paramete

  • Fios tv menu and no "home monitoring & control" app anymore!

    i used to be able to view my hm&c devices, like my live camera feed, on my tv thru the fios tv menu.....i pay 9.99 per month for this super lo-resolution, slow, and no-audio-enabled-although-the-camera-can-handle-it so-called "security camera", and