JDBC - CallableStatement - Error in Accessing Stored Procedure of MS SQL

Dear Friends,
The following is the code to access a stored procedure of MS SQL Server 7.0 sp4,
          try
               CallableStatement cstmt;
               ResultSet rst;
               cstmt = connection.prepareCall("{call backupdb[?,?]}");
               cstmt.setString("db_name","SBIREMITLIVE");
               cstmt.setString("path", "c:\testing.bak");
               cstmt.executeQuery();
               System.out.println("Stored Procedure called successfully");
          catch(SQLException se)
               System.out.println(se.toString());
when i execute this i am getting the error as " MS ODBC-MS SQL Server Syntax error or Access Violation "
What's the problem exactly ? anybody came across this issue..if so...kindly help me....
Here is my MS SQL Server stored procedure.....for reference
create procedure backupdb(@db_name varchar(40), @path varchar(100)) as
Backup database @db_name to disk = @path
Regards,
V.Prasanna

Dear DigitalDreamer,
Yes, as per your suggestion, it's working fine...thanks a lot...
here is the code...
               CallableStatement cstmt;
               ResultSet rst;
               cstmt = connection.prepareCall(" exec backupdb ?,? ");
               cstmt.setString(1,"SBIREMITLIVE");
               cstmt.setString(2, "c:\\testing.bak");
               cstmt.execute();
Regards,
V.Prasanna

Similar Messages

  • Error connecting to stored procedure in crystal report

    Hello
    I'm using crystal reports 2008 with the latest service pack.
    i'm trying to access stored procedure using the mysql jdbc driver 5.17. The crystal report has been designed which works fine with a login that created the stored procedure but when i try to run with another login that will used to run the crystal reports
    The login has access to execute the stored procedure but entered in the crystal report it complains about
    "User does not have access to metadata required to determine stored procedure parameter types. If rights cannot be granted, configure with {noAccessToProcedureBodies=true} to have driver generate parameters that represent INOUT strings irregardless of actual paramter types"

    Hi Sharon
    Thanks for response.
    I have checked that the user has permission to read and write. When i try and execute the stored procedure in the database by login with the user, it runs fine.
    When i try and call the stored procedure from crystal reports it throws that error message.
    regards
    Naresh

  • Sqlexception ,when trying to access stored procedure

              hi
              i have a strange problem, iam using jsp code for accessing stored procedure in sql
              server database, below is my java code which calls stored procedure,
              <%
                   CallableStatement cstmt=null;
                   String sql= "{?= call ascs_submit_prem_adj(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
                   cstmt=con.prepareCall(sql);
                   cstmt.registerOutParameter(1,java.sql.Types.INTEGER);
                   cstmt.registerOutParameter(2,java.sql.Types.INTEGER);
                   cstmt.setObject(3,adjustId);
                   cstmt.setString(4,co_id);
                   cstmt.setString(5,policyNo);
                   cstmt.setString(6,subPolicy);
                   cstmt.setString(7,busDiv);
                   cstmt.setString(8,commAcct);
                   cstmt.setString(9,agentId);
                   cstmt.setString(10,premAmount);
                   cstmt.setString(11,dueDate);
                   cstmt.setString(12,lobCd);
                   cstmt.setString(13,commAmount);
                   cstmt.setString(14,commReason);
                   cstmt.setString(15,recovFlag);
                   cstmt.setString(16,recovPercent);
                   cstmt.setString(17,combId);
                   cstmt.setString(18,payFlag);
                   cstmt.setString(19,combAcct);
                   cstmt.setString(20,combSub);
                   cstmt.setString(21,paidFlag);
                   cstmt.setString(22,changeBy);
                   cstmt.setString(23,transDt);
                   cstmt.execute();
              ERROR LINE-->     adjustId=cstmt.getObject(2).toString();
                   spReturnCode=cstmt.getInt(1);
              %>
              i hv two output parameters,,when i try to get the second output parameter (ie ERROR
              LINE)
              IAM GETTING a strange error, i don't know what it is? this is the error i got
              Tue Feb 13 10:06:26 EST 2001:<E> <ServletContext-General> exception raised on '/
              PremAdjSubmit.jsp'
              java.sql.SQLException: Invalid column number (2). This table has 1 columns (a va
              lid index is 1 trough 1).
              at weblogic.jdbcbase.mssqlserver4.TdsResultSet.getEntry(TdsResultSet.jav
              a, Compiled Code)
              at weblogic.jdbcbase.mssqlserver4.TdsResultSet.getObject(TdsResultSet.ja
              va, Compiled Code)
              at weblogic.jdbcbase.mssqlserver4.TdsStatement.getObject(TdsStatement.ja
              va:2338)
              at jsp_servlet._premadjsubmit._jspService(_premadjsubmit.java, Compiled
              Code)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java, Compiled Code)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java, Compiled Code)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java, Compiled Code)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java, Compiled Code)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              ContextManager.java, Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              a, Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java, Com
              piled Code)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              detailed error-----------
              Error Found
              Oops! an exception occurred.
              The name of the exception is
              java.sql.SQLException: Invalid column number (2). This table has 1 columns (a valid
              index is 1 trough 1).
              can any one help me out...
              thanks
              san
              

              hi
              i have a strange problem, iam using jsp code for accessing stored procedure in sql
              server database, below is my java code which calls stored procedure,
              <%
                   CallableStatement cstmt=null;
                   String sql= "{?= call ascs_submit_prem_adj(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
                   cstmt=con.prepareCall(sql);
                   cstmt.registerOutParameter(1,java.sql.Types.INTEGER);
                   cstmt.registerOutParameter(2,java.sql.Types.INTEGER);
                   cstmt.setObject(3,adjustId);
                   cstmt.setString(4,co_id);
                   cstmt.setString(5,policyNo);
                   cstmt.setString(6,subPolicy);
                   cstmt.setString(7,busDiv);
                   cstmt.setString(8,commAcct);
                   cstmt.setString(9,agentId);
                   cstmt.setString(10,premAmount);
                   cstmt.setString(11,dueDate);
                   cstmt.setString(12,lobCd);
                   cstmt.setString(13,commAmount);
                   cstmt.setString(14,commReason);
                   cstmt.setString(15,recovFlag);
                   cstmt.setString(16,recovPercent);
                   cstmt.setString(17,combId);
                   cstmt.setString(18,payFlag);
                   cstmt.setString(19,combAcct);
                   cstmt.setString(20,combSub);
                   cstmt.setString(21,paidFlag);
                   cstmt.setString(22,changeBy);
                   cstmt.setString(23,transDt);
                   cstmt.execute();
              ERROR LINE-->     adjustId=cstmt.getObject(2).toString();
                   spReturnCode=cstmt.getInt(1);
              %>
              i hv two output parameters,,when i try to get the second output parameter (ie ERROR
              LINE)
              IAM GETTING a strange error, i don't know what it is? this is the error i got
              Tue Feb 13 10:06:26 EST 2001:<E> <ServletContext-General> exception raised on '/
              PremAdjSubmit.jsp'
              java.sql.SQLException: Invalid column number (2). This table has 1 columns (a va
              lid index is 1 trough 1).
              at weblogic.jdbcbase.mssqlserver4.TdsResultSet.getEntry(TdsResultSet.jav
              a, Compiled Code)
              at weblogic.jdbcbase.mssqlserver4.TdsResultSet.getObject(TdsResultSet.ja
              va, Compiled Code)
              at weblogic.jdbcbase.mssqlserver4.TdsStatement.getObject(TdsStatement.ja
              va:2338)
              at jsp_servlet._premadjsubmit._jspService(_premadjsubmit.java, Compiled
              Code)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java, Compiled Code)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java, Compiled Code)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java, Compiled Code)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java, Compiled Code)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              ContextManager.java, Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              a, Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java, Com
              piled Code)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              detailed error-----------
              Error Found
              Oops! an exception occurred.
              The name of the exception is
              java.sql.SQLException: Invalid column number (2). This table has 1 columns (a valid
              index is 1 trough 1).
              can any one help me out...
              thanks
              san
              

  • Error while Executing stored procedure using ant

    Hi,
    I am trying to execute a stored procedure using ant ..
    My build.xml is like this...
    <project name="myproject" default="db.build">
    <target name="db.build">
    <sql driver="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:@idm.orademo.com:1521:orcl"
    userid="test"
    password="oracle11g"
    print="yes"
    classpath="E:\\ojdbc14.jar"
    src="E:\\upg_9102BP07.sql" />
    <!--
    <classpath>
    <pathelement path=""\\>
    <\\classpath> -->
    </target>
    </project>
    I have my stored procedure in upg_9102BP07.sql as shown in above src..
    When im executing ant cmd I got the following exception
    E:\>ant -f test.xml
    Buildfile: test.xml
    db.build:
    *[sql] Executing resource: E:\upg_9102BP07.sql*
    *[sql] Failed to execute: declare cnt int*
    BUILD FAILED
    E:\test.xml:12: java.sql.SQLException: ORA-06550: line 1, column 15:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    *:= . ( @ % ; not null range default character*
    Total time: 44 seconds
    I have no clue.. But this sql ran successfully when did manually..
    Please help me in solving the issue...
    -- Marias

    Here is my script bit lengthy...
    Rem
    Rem $Header: oim/server/Database/Oracle/Upgrade/Release91x/910x/List/9102_ddl_AddcolumnToRCE_Oracle.sql st_oim_devjain_bug-9003841/1 2009/10/09 02:24:19 devjain Exp $
    Rem
    Rem 9102_ddl_AddcolumnToRCE_Oracle.sql
    Rem
    Rem Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
    Rem
    Rem NAME
    Rem 9102_ddl_AddcolumnToRCE_Oracle.sql - <one-line expansion of the name>
    Rem
    Rem DESCRIPTION
    Rem Create a new column 'RCE_DELETE' in RCE table
    Rem
    Rem MODIFIED (MM/DD/YY)
    Rem blaksham 09/30/09 - Created
    Rem
    declare cnt int;
    Begin
         Select Count(1) into cnt From User_Tab_Columns Where TABLE_NAME='RCM' And COLUMN_NAME='RCM_DELETE';
         IF cnt=0 Then
         Begin
              Execute Immediate 'ALTER TABLE RCM ADD RCM_DELETE VARCHAR2(1)';
         End;
         Else
              DBMS_OUTPUT.PUT_LINE('Column already exists in the DB');
         End IF;
    End;
    Rem
    Rem $Header: oim/server/Database/Oracle/Upgrade/Release91x/910x/List/9102_dml_odf_source_name.sql st_oim_devjain_bug-9003841/1 2009/10/09 02:44:45 devjain Exp $
    Rem
    Rem 9103_dml_odf_source_name.sql
    Rem
    Rem Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
    Rem
    Rem NAME
    Rem 9103_dml_odf_source_name.sql - <one-line expansion of the name>
    Rem
    Rem DESCRIPTION
    Rem <short description of component this file declares/defines>
    Rem
    Rem NOTES
    Rem <other useful comments, qualifications, etc.>
    Rem
    Rem MODIFIED (MM/DD/YY)
    Rem vpotukuc 09/17/09 - Bug8796435: Increase the size of odf_source-name
    Rem vpotukuc 09/17/09 - Created
    Rem
    SET ECHO ON
    SET FEEDBACK 1
    SET NUMWIDTH 10
    SET LINESIZE 80
    SET TRIMSPOOL ON
    SET TAB OFF
    SET PAGESIZE 100
    declare
    collen NUMBER := 0;
    begin
    select char_length into collen from user_tab_columns where table_name = 'ODF' and column_name = 'ODF_SOURCE_NAME';
    IF (collen < 400) then
    execute immediate 'alter table ODF modify ODF_SOURCE_NAME varchar2(400)';
    END IF;
    END;
    File name: 91_dml_update_reviewers_With_NoEmail_attestation.sql
    Purpose: Modify the email template to replace the 'Delegated By Last Name' with 'Reviewer Last Name' and 'Delegated By User Id' to 'Reviewer User Id'.
    Author: Babu Lakshamanaiah
    Description: Modify the email template 'Attestation Reviewers With No E-mail Addresses Defined'
    declare
    cnt int;
    begin
    Select Count(1) into cnt From emd Where emd_name='Attestation Reviewers With No E-mail Addresses Defined' and emd_language='en' and emd_country='US';
    IF cnt=0 Then
    Begin
    DBMS_OUTPUT.PUT_LINE('There is no record with emd_name Attestation Reviewers With No E-mail Addresses Defined ');
    End;
    Else
    update emd set emd_body='The following attestation reviewers do not have email addresses defined. Attestation requests have been generated for these reviewers and can be accessed by loging in to Oracle Identity Manager. However, notification emails were not sent.' ||chr(10) || chr(10) ||
    'Attestation process: <Attestation Definition.Process Name>' || chr(10) ||
    'Attestation Request ID: request <Attestation Request.Request Id>' || chr(10) ||
    'Request date: <Attestation Request.Request Creation Date>' || chr(10) || chr(10) ||
    'Reviewers Without E-mail Address: <reviewers> ' || chr(10) ||
    '<Attestation Task.Reviewer First Name> <Attestation Task.Reviewer Last Name> [<Attestation Task.Reviewer User Id>]' Where emd_name='Attestation Reviewers With No E-mail Addresses Defined' and emd_language='en' and emd_country='US';
    End IF;
    commit;
    end;
    Please help me out.....
    --Marias                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • ERROR-Logging of Stored Procedure (Stop / Going on after error + logging)

    Hi @all,
    I am using a Stored Procedure which is very simple:
    =>The stored procedure is selecting many tousands of records from table1 + table2.
    => Some values (records) will be summarized (aggregated/group by).
    =>After this selection and summarizing, this records will be deleted from table3 (if they exist in table3).
    =>Then the selected records will be inserted in table3.
    Now I want to do the following:
    Is there a way to log the errors of the stored procedure?
    For example, the stored procedure is copying many thousands of records.
    If there is a problem on copying/ inserting a record to table3, then I want a error-log in a loggin_table.
    Is there a way to write the error-logs from a stored procedure to a special table in database?
    I want to do this in 2 ways:
    1) On error the error is logged and the stored procedure is stopped.
    2) On error the error is logged and the stored procedure is going on to insert/summarize the next record.
    I don't know how I can get these errors of a stored procedure. Maybe it isn't possible? Or is it better to use a function?
    Hope anyone can give me a hint?
    Thanks a lot.
    Best regards,
    Tim

    Hi
    option one:
    as i know you can have another table without primer key (log table).
    then before you insert into table, select the record count using primary key. if it is duplicate then put those record into the table.
    option two:
    write the log into file.
    declare
    f utl_file.file_type;
    s varchar2(200);
    begin
    f := utl_file.fopen('SAMPLEDATA','sample1.txt','R');
    loop
    utl_file.get_line(f,s);
    dbms_output.put_line(s);
    end loop;
    exception
    when NO_DATA_FOUND then
    utl_file.fclose(f);
    end;
    refer : http://www.psoug.org/reference/OLD/utl_file.html
    regards
    upul.
    Edited by: Upul Indika on Apr 9, 2009 12:45 PM

  • Passing Parameters in Crystal XI (v1) to SQL or MS Access Stored Procedures

    Post Author: mib
    CA Forum: Crystal Reports
    In Crystal Reports 8.5 I had a report with a parameter called WeekCommencing which was
    a datetime parameter.  This worked against a stored procedure in a SQL
    database and a union query with a parameter within MS Access database
    - my application works on either platforms.
    Now in Crystal XI, Crystal is now looking for a parameter called
    @WeekCommencing which would be the full name in the stored procedure
    but if I rename the parameter the same report would no longer work
    against the MS Access database.
    Anyone have any suggestions?

    Post Author: mib
    CA Forum: Crystal Reports
    In Crystal Reports 8.5 I had a report with a parameter called WeekCommencing which was
    a datetime parameter.  This worked against a stored procedure in a SQL
    database and a union query with a parameter within MS Access database
    - my application works on either platforms.
    Now in Crystal XI, Crystal is now looking for a parameter called
    @WeekCommencing which would be the full name in the stored procedure
    but if I rename the parameter the same report would no longer work
    against the MS Access database.
    Anyone have any suggestions?

  • Pass a jdbc resultset in to a Stored Procedure

    Any answer to the following question would be highly appreciated:
    How can we pass a jdbc resultset in to a Stored Procedure?
    Thanks.

    You could use Oracle's ANYDATASET type or declare schema TYPEs to support passing the data in a known structure. See "Working with Oracle Collections" in the "JDBC Developer's Guide and Reference" on technet.

  • UCCX 8.5 - Accessing stored procedure result

    Hi,
    I am trying to access a stored procedure through UCCX script.
    I can access a stored procedure by following SQL query through DBRead step and it is successfully getting executed.
    DECLARE         @return_value int,
                            @Result int;
                EXEC        @return_value = [dbo].[SP_ValidateUser]
                                @ContactPersonId =$input1 ,
                                @ContactPersonTypeid = $input2 ,
                                @Result = @Result OUTPUT;
             SELECT        @Result as '@Result'
    I have to get the output of stored procedure in UCCX script variable. Is there any way to get it through DBGet Step.
    Any help regarding this is greatly appreciated.
    Thanks,
    Indumathi.P

    Hi Indumathi,
    Have you got a response to this? I am also looking for a solution to get the output of Stored procedure in my UCCX local script variable. Can you kindly provide me with the script solution?
    Thank you
    Regards
    Jeesh

  • How to invoke a stored procedure on MS Sql Server with Java?

    I started writing Enterprise Java Beans and created an ODBC dsn with MS Sql Server 2000 which I can access using jdbc:odbc:mySqlDSN. This all works fine using Java Sql Statements. What kind of Java/Java Sql statement can I use to invoke a stored procedure on the Sql Server? Is it possible to use ADO/ADO command objects with Java? Is it possible to import/implement Mdac2.6 ActiveX data objects libary in Java?
    Thanks

    Thanks all for your replies. I will search the api for callable statements. I am curious though, the reply that suggests using a prepared statement - can I put the name of a stored procedure in a prepared statment or is this just suggestions an action query like Insert Into, Update, Delete? Like with ADO you can say
    cmdObject.CommandType = adStoredProcedure
    cmdObject.CommandText = "NameOfStoredProc"
    cmdObject.ExecuteNonQuery()
    Once I am calling/importing/implementing the proper libraries/interfaces in Java, can a prepared statement reference a stored procedure as above?
    Thanks

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

    I'm trying to call a stored procedure from embedded sql. I'm following the examples located in
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/a96109/pco06pls.htm#i9641
    I have the following section in my .pco file before precompiling.
    exec sql execute
    begin
    docs.grant_access_to_all_categories(:p_sam_id);
    end;
    end-exec.
    When running procob on the file with the above code I get the following error.
    Error at line 225, column 13 in file pco\docs_stored_procedures.pco
    exec sql execute
    ............1
    PCB-S-00576, PLS-201: identifier 'DOCS.GRANT_ACCESS_TO_ALL_CATEGORIES' must be d
    eclared
    Error at line 225, column 13 in file pco\docs_stored_procedures.pco
    exec sql execute
    ............1
    PCB-S-00576, PLS-0: Statement ignored
    Any ideas on what I am doing wrong on calling this stored procedure.

    I get the same error when trying to precompile sample11.pco from the demo directory in the oracle client software.
    Error at line 70, column 12 in file sample11.pco
    EXEC SQL EXECUTE
    ...........1
    PCB-S-00576, PLS-201: identifier 'EMP_DEMO_PKG.OPEN_CUR' must be declared
    Error at line 70, column 12 in file sample11.pco
    EXEC SQL EXECUTE
    ...........1
    PCB-S-00576, PLS-0: Statement ignored

  • Running a Stored Procedure in Oqacle SQL Developer

    Hi All,
    Could anybody elaborate on the procedure to execute a Stored Procedure in Oracle SQL Developer. I feel we need to configure the output for the DBMS_OUTPUT
    Cheers,
    Bell

    on the procedure to execute a Stored Procedure in Oracle SQL Developer.Select the procedure or package spec in the Connections panel. Right click with the mouse. This will bring up a panel with an anonymous block to run the code and property sheets to populate the parameters, etc.
    Cheers, APC

  • Writing a stored procedure to import SQL Server table data into a Oracle table

    Hello,
    As a new DBA I have been tasked with writing a stored procedure to import SQL Server table data into an Oracle table. I have been given many suggestions on how to do it from SQL Server but I I just need to write a stored procedure to run it from the Oracle side. Suggestions/guidance on where to start would be greatly appreciated! Thank you!
    I started to write it based on what I have but I know this is not correct :/
    # Here is the select statement for the data source in SQL Server...
    SELECT COMPANY
    ,CUSTOMER
    ,TRANS_TYPE
    ,INVOICE
    ,TRANS_DATE
    ,STATUS
    ,TRAN_AMT
    ,CREDIT_AMT
    ,APPLD_AMT
    ,ADJ_AMT
    ,TRANS_USER1
    ,PROCESS_LEVEL
    ,DESCRIPTION
    ,DUE_DATE
    ,OUR_DATE
    ,OUR_TIME
    ,PROCESS_FLAG
    ,ERROR_DESCRIPTION
      FROM data_source_table_name
    #It loads data into the table in Oracle....   
    Insert into oracle_destination_table_name (
    COMPANY,
    CUSTOMER,
    TRANS_TYPE,
    INVOICE,
    TRANS_DATE,
    STATUS,
    TRANS_AMT,
    CREDIT_AMT,
    APPLD_AMT,
    ADJ_AMT,
    TRANS_USER1,
    PROCESS_LEVEL,
    DESCRIPTION,
    DUE_DATE,
    OUR_DATE,
    OUR_TIME,
    PROCESS_FLAG,
    ERROR_DESCRIPTION)
    END;

    CREATE TABLE statements would have been better as MS-SQL and Oracle don't have the same data types.
    OUR_DATE, OUR_TIME will (most likely) be ONE column in Oracle.
    DATABASE LINK
    Personally, I'd just load the data over a database link:
    insert into oracle_destination_table_name ( <column list> )
    select ... <transform data here>
    from data_source_table@mssql_db_link
    As far as creating the database link from Oracle to MS-SQL ... that is for somebody else to answer.
    (most likely you'll need to use an ODBC driver)
    EXTERNAL TABLE
    If the data from MS-SQL is in a CSV file, just use and external table.
    same concept:
    insert into oracle_destination_table_name ( <column list> )
    select ... <transform data here>
    from data_source_external_table
    MK

  • Stored Procedure in NAtive SQL

    Hello All,
    Where to check the definition of the following stored procedure in NAtive SQL.
    EXEC SQL.
        EXECUTE PROCEDURE "APS_PEGID_GET_IO" (
                             IN  :LS_GEN_COM_PARAMS,
                             OUT :LV_RC,
                             IN  :ET_RC,
                             IN  :IT_PEGAREA,
                             IN  :IT_PEGID_DESC_CHAR,
                             IN  :IT_ORDER_TYPES,
                             IN  :IT_ORDER_STATUS,
                             IN  :IT_CATEGORY,
                             IN  :IT_CHARACT_REQ_OUTNODE,
                             IN  :IT_CHARACT_VAL_INPNODE,
                             IN  :IT_SUPPLY_AREA,
                             IN  :IT_EXT_FIXED,
                             IN  :IT_TOPORDER_EXCLUDES,
                             IN  :IV_IONODE_PEG_SEL,
                             IN  :IV_START_TIME,
                             IN  :IV_END_TIME,
                             IN  :IT_ORDER_REQTIME,
                             IN  :LS_GETIO_OPTIONS,
                             IN  :IS_EXCLUDE_FIELDS,
                             IN  :ET_POSITIONS,
                             IN  :ET_IONODES,
                             IN  :ET_IONODES_CONF,
                             IN  :ET_CONTI_IO,
                             IN  :ET_CHARACT_REQ_INPNODE,
                             IN  :ET_CHARACT_VAL_OUTNODE,
                             IN  :ET_FIXPEG)
      ENDEXEC.
    kindly help
    its urgent.
    thank u in advance.
    Regards,
    Pranali

    Hi Pranali,
    Please tell me too if you have resolved the issue.
    Thanks & Regards,
    Manali

  • Turning a stored procedure or PL/SQL into a web (SOAP call)

    what is the easiest way of turning a stored procedure or PL/SQL into a web service (soap call).
    I need to have detailed way of doing it ...

    Have a look at: http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html

Maybe you are looking for

  • Detailed error message in sxmb_moni

    Hi guys, is it possible to get detailed error information in sxmb_moni like the error information in the integration repository when using the test tag sample error message in test tab +ns0:ZMOZPRUCK_envelope_update/ns0:ZMOZZFZT_update[4]/ns0:dbTable

  • IWeb 08 making all photos dark!!!

    Has anyone else noticed this? I am a professional photographer, and I'm TRYING to make a living from how awesome my images look. Ever since I upgraded to iLife '08 I've had problems with the photos on all the pages looking horrible! When you click on

  • Creating Material Reservations for vendor consignment stocks

    Hi, Are we able to create reservations (Tcode : MB21) for vendor consigned-stocks? I tried but there is no option to key in the special stock type in the material reservation. Anyone can help? rgds, wl

  • Error 49 when instantiating InitalContextDirectory

    I wrote some code that uses JNDI & LDAP to access Novel Directory Service (NDS) to obtain authentication. This has been working fine for many months. Our shop is in the process of moving from NDS to Active Diretory Service (ADS). As a result I've cha

  • Number lock shortcut on keyboard with number pad

    How do I turn number lock back on? Somehow I turned the number lock off, probably while cleaning the keyboard.