Executing Store Procedure random timeouts

We have some simple stored procedures that run find when run under the Advantage Data Architect, but randomly times out when we call them from our ASP web site using the OLEDB driver.
When we try to call them using the Advantage Java database driver we get and error code 9105 SQL state S0000 error with no descripive message.
Does anyone have any insights into either of these issues?
Dave Anderson

Your stored procedure only takes Milliseconds to finish normally?
How do you know it is timing out?  The default is 30 seconds so seeing it timeout I would have assumed it was a longer running one.  Are you getting the ADS error 7209 back or Run-Time error
'3712' Operation has been cancelled by the user?
It's been ages since I've looked at VB, but I think it should be something like this
cmd = New ADODB.Command
cmd.CommandText = "execute procedure ....."
cmd.CommandType = adCmdText
cmd.CommandTimeout = 0
rs = cmd.Execute
For the JDBC issue, it is difficult to tell by the date, but I think that date indicates likely a 10.x or 11.x driver.  The issue I was thinking of I believe was fixed in 9.x.
You can try the latest 11.1 version (11.10.0.20) as I think that was released in July of this year.  Maybe it will help?  If not a support incident would be a good idea (particularly if you can duplicate it)
Out of curiosity are you using the varying output type stored procedures?  (Not that I have anything to offer as a workaround, but the error is indicating there was a problem retrieving column informaiton and this is the only thing I can think of off the top of my head).
Edgar

Similar Messages

  • Execute store procedure( in Id, in out RefCursor), and data fetched in ref cursor should be sent out as excel sheet.

    I am trying to make a ssis package that get the data calling the store proc with two param one is ID and other is Sys_refcursor. Say Store Proc as ListName(Id int, myCur sys_refcursor), which gets the datas with the conditions inside it.
    REATE OR REPLACE PROCEDURE schemaName.LISTNAME (P_ID  IN INT, LST_NAME_REFCUR   IN OUT SYS_REFCURSOR)
    IS
    P_NAMESOURCE_ID INT;
    BEGIN
        SELECT SOURCE_ID INTO P_NAMESOURCE_ID FROM SEARCHING_TABLE ST WHERE ST.ID = P_ID;           
                   IF (P_NAMESOURCE_ID=1)
                   THEN
                      OPEN LST_SOURCE_REFCUR FOR 
                            SELECT ST.ID,
                                   ST.TRANSACTION_DATE AS TRAN_DATE,
              IF (P_NAMESOURCE_ID=1)
                   THEN 
                      OPEN LST_SOURCE_REFCUR FOR             ....     
    then i need to get the data from that refcursor and fetch those data to excel sheet to a virtual directory.
    Any help would be appreciated. I am new to SSIS. and i need to do this assignment this friday. 

    Hi 11srk,
    To fetch data from Oracle store procedure, you can use a Script Component as source to call the Oracle stored procedure by using System.Data.OracleClient OracleDataReader, and get the rows and add them to the pipeline buffer. For more information, please
    see:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1d0b3a1b-8792-469c-b0d1-f2fbb9e9ff20/dump-oracle-ref-cursor-into-ms-sql-staging-table-using-ssis
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/fcdaa97e-8415-4c3e-8ffd-1ad45b590d57/executing-an-oracle-stored-procedure-from-ssis?forum=sqlintegrationservices
    http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracledatareader(VS.90).aspx  
    Regards,
    Mike Yin
    TechNet Community Support

  • Execute Store procedure from derived table

    I would like to create a devired table to use in the LOV for my prompt.  Can I execute a store procedure in the defintion of the derived table instead of a sql statement ?  My store procedure is in a sql 2008 database

    Derived Table and SP are not the same. Derived table is more like a database view and is not a replacement for SP. I'd suggest you to use Derived table only if it is not possible to create a database table/view.
    Is it necessary for you to use your stored procedure as a data source? Are you trying to join it's result set to another table or view?
    You can create Materialized view in the database. Use that as a table in Universe.
    Try to use this object LOV in your prompt.

  • Execute store procedure from form

    How do I execute a store procedure from FORM
    I have a store procedure in the database
    all it does insert a value to table test.
    in 'WHEN-NEW-INSTANT-TRIGGER' of the form MODLUE I put
    test_curor; (name of the store procedure)
    The module does have block or any thing it.
    There was no syntax errors or form error
    but it did not insert into the table.
    Why????

    I just tested this myself and you are right. If you have one block with no items in it the when-new-form-instance trigger will not be fired. I got a message back saying 'block had no items', though it ran OK. This kinda makes logical sense, since there is nothing for the form to do. I put a button onto the block and the procedure fired no problem. I must admit I have never tried creating a form with no items in it so I haven't seen this behaviour before.
    Shucks you live and learn every day!

  • Error while executing store procedure

    we are using JSQLConnect jdbc driver 3.0 verson.
    When we trued to excute store procedures its giving error like
    com.jnetdirect.jsql.w: Stored procedures called with static parameters cannot return output parameter values, please use CallableStatement.setXXX() to set the values of all input parameters.
    we are using SQLServer2000.
    Could anybody tell me why this is error is coming and how to solve this.
    Thanks
    Hemanth

    Obviously it doesn't like the stored procedure. If you posted the signature for that it might help.
    You are using a CallableStatement right?

  • Keeps asking for rpt file when executing store procedure

    Hi all,
      I have coded an standard stored procedure but when I execute it, Management Studio keeps asking for .rpt file to save the results. I am using Enterprise 2008 R2. 
    This is the code:
    USE [mydatabase]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[usp_chart](
    @parameters)
    AS
    BEGIN
     SET NOCOUNT ON;    
     DECLARE @query NVARCHAR(4000)
        DECLARE @total INT
        DECLARE @strDescriptor NVARCHAR(4000)
        DECLARE @dsvalues NVARCHAR(4000)
        DECLARE @strCache NVARCHAR(2000)
        SET @strDescriptor = dbo.udf_chart_derived_descriptor_intotemp(@derivation_Id)
     SET @dsvalues =  dbo.udf_chart_derived_dynamic_query_fortopn(  @derivation_Id,
           @cache_Id,
           @topn,
          @flt_customer_Id,
          @flt_user_Id,
          @flt_datefrom,
          @flt_dateto,
          @product_Id
        SET @strCache = 'SELECT top ' + @topn + 'PERCENT g.Supplier_Id Supplier_Id 
    INTO #T_CacheTopN
    FROM T_CacheSupp g 
    WHERE g.Cache_Id = ' + @cache_Id + 
    ' ORDER BY g.Position'
        IF @strFilter is null 
         BEGIN
    SET @query = @strCache + ';' + @strDescriptor + ';' +
    'DECLARE @total INT;' +
    @dsvalues +
    'SELECT @total = COUNT(*)
     FROM #T_Condition; 
     SELECT c.Condition_Index, ROUND(COUNT(*)/CAST(@total as float),2)*100
     FROM #T_Condition c
     GROUP BY c.Condition_Index';
         END
        ELSE
         BEGIN
           DECLARE @sqlfilter NVARCHAR(2000)
      SET @sqlfilter =  dbo.udf_chart_dynamic_query_filter_fortopn(@strFilter,@product_Id,@topn, @cache_Id)
      SET @query = @strCache + ';' +@strDescriptor + ';' +
    'DECLARE @total INT;' +
    @dsvalues +
    'SELECT @total = COUNT(*)
     FROM #T_Condition;'+ @sqlfilter +
     ';SELECT c.Condition_Index, ROUND(COUNT(*)/CAST(@total as float),2)*100 
     FROM #T_Condition c LEFT OUTER JOIN #T_NotWanted d
     ON c.Data_Id = d.Data_ID
     WHERE d.Data_Id is null
     GROUP BY c.Condition_Index';
         END 
        EXEC(@query)
        RETURN
    END
    When I execute:
    DECLARE
    @parameters NVARCHAR(4000)
    execute usp_chart_derived_fortopn @parameters
    it asks me for a .rpt file.
    Why is that? I am not running a report.
    Thanks

    As other have said, you have set Results to File.
    But since you posted your code, I had a look at it. I was not able to understand why you use dynamic SQL. For instance, this:
        SET @strCache = 'SELECT top ' + @topn + 'PERCENT g.Supplier_Id Supplier_Id 
    INTO #T_CacheTopN
    FROM T_CacheSupp g 
    WHERE g.Cache_Id = ' + @cache_Id +  ' ORDER BY g.Position'
    Can be written as
    SELECT top (@topn) PERCENT g.Supplier_Id Supplier_Id 
    INTO #T_CacheTopN
    FROM T_CacheSupp g 
    WHERE g.Cache_Id = @cache_Id  
    ORDER BY g.Position
    If you can avoid dynamic SQL, your code becomes easier to maintain, and less vulnerable for nasty surprises.
    And if you use dynamic SQL, you should use sp_executesql and pass parameter values as parameters instead of inlining them.
    Erland Sommarskog, SQL Server MVP, [email protected]
    Links for SQL Server Books Online:
    SQL 2008, SQL 2005 and 
    SQL 2000.
    (Just click the link you need.)

  • Store Procedure execution using dataset

    hi friends
    can anybody tell me how to execute oracle stored procedure using dataset in C#
    Thnx
    Monika

    Double post?
    execute store Procedure in Oracle

  • Execute Oracle procedure via Linked server takes very long

    Exec ('Begin [procedurename]; End;') at OracleLinkedServer
    I used this statement to execute store procedure on Oracle database via linked server. It keeps running and never ends.
    However, if I run this procedure Begin [procedurename]; End; in TOAD, it completes in 10s. 
    This procedure is just simply to merge data between two tables.
    Is there any bug or limit on SQL Server Oracle linked server? I am using SQL SERVER 2012 and Oracle 11g client.

    See if this link helps you
    http://markmal.blogspot.co.il/2008/01/it-is-really-pain-if-you-need-to-call.html
    select * from openquery(MYORADB, '{CALL SCOTT.PROC4MS({resultset 25, OUTPUT})}');
    SELECT * FROM OPENQUERY(<linked server name>, '{CALL <oracle sp>}')
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • HOW TO EXECUTE A STORE PROCEDURE THAT RETURN MULTIPLE ROWS FROM A QUERY

    I NEED TO CREATE AND USE A STORE PROCEDURE THAT IS GOING TO DO A SELECT STATEMENT AN THE RESULT OF THE SELECT STATEMENT IS RETURN IN SOME WAY TO THE REQUESTER.
    THIS CALL IS MADE BY AN EXTERNAL LANGUAGE, NOT PL/SQL OR FORMS APPLICATION. USING FOR EXAMPLE ODBC AND VISUAL BASIC. WHAT I NEED TO DO IS ADD A DATA ACCESS LAYER TO MY APPLICATION AND I ALREADY HAVE IT DONE FOR MS SQL SERVER, BUT I NEED THE SAME FUNCTIONALITY ACCESSING AN ORACLE DATABASE.
    FLOW:
    1. VB CREATE A ODBC CONNECTION TO A ORACLE DATABASE
    2. VB EXECUTE A STORE PROCEDURE
    3. THE STORE PROCEDURE RETURNS TO THE VB APPLICATION THE RESULT OF THE QUERY THAT IS INSIDE OF THE STORE PROCEDURE.(I.E. THE STORE PROCEDURE IS A BASIC SELECT, NOTHING COMPLEX)
    4. VB DISPLAY THE RESULT IN A GRID
    FOR SURE I CAN DO THE SELECT DIRECTLY TO ORACLE, BUT FOR PERFORMANCE REASONS AND SCALABILITY, I'LL LIKE IT TO DO IT USING A STORE PROCUDURES
    IS THIS POSIBLE?, HOW?
    THANKS

    Certainly, it's possible. First, define a stored procedure that includes an OUT parameter which is a REF CURSOR. Then, call the stored procedure via ODBC omitting the OUT parameter from the list of parameters. IT will automatically be returned as a result set. Syntax for both is below...
    CREATE PROCEDURE foo (inParam in varchar2, resultSet OUT REF CURSOR )
    In ODBC:
    {call foo( 'someData' )}
    Justin

  • Execute Unix Mail Command from Store Procedure

    Hi Colleagues!
    I designed a store procedure that Monitoring some Critical tables in my Oracle 8.0.6.1.0 Database But I need to send some Emails from the Store Procedures to Information System Staff when the amount of rows increase too much. I read about UTL_SMTP but my database version is too old to run this package. Also I have the option of Maildemo8i that execute MS Oulook from a Client System But I looking to Send it from my Database(OS HPUX). So please take a look of this issue and I will appreciate any help.
    Your Friend.
    Emmanuel Carrillo Trejos.
    LNB, Republic of Panama(Central America).
    P.D. You can email to: [email protected]

    Do you mean that you want to execute mail or mailx unix commands to send mails.If i am right then probably you are looking for a way to execute operating system commands from your procedure.
    You can refer this link if you want to do that. You need java support in your Oracle database and i believe that Oracle 8 does have jvm running in the instance.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:5079825575573830264::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:952229840241
    Thank you!

  • How to execute a store procedure

    Hi Forum
    I have a store procedure with 4 variables in and 1 out, how to execute via sql this procedure for obtain the result in the out variable.
    Thanks and regards

    SQL> create or replace procedure test_proc (
      2     a in number,
      3     b in number,
      4     c in number,
      5     d in number,
      6     outvar out number) is
      7  begin
      8     outvar := a + b + c + d;
      9* end;
    SQL> /
    Procedure created.
    SQL> variable var1 number;
    SQL> exec test_proc (1, 2, 3, 4, :var1);
    PL/SQL procedure successfully completed.
    SQL> print var1
          VAR1
            10
    SQL>

  • (Resolved) How to execute 2 store procedures in 1 transaction?

    public void method1(){
    Session session = getSessionFactory().acquireSession();
    StoredProcedureCall spc1 = new StoredProcedureCall();
    spc1.setProcedureName("PKG.SP1");
    spc1.addNamedArgumentValue("param", "aaa");
    session.executeNonSelectingCall(spc1);
    StoredProcedureCall spc2 = new StoredProcedureCall();
    spc2.setProcedureName("PKG.SP2");
    spc2.addNamedArgumentValue("param", "bbb");
    session.executeNonSelectingCall(spc2);
    The above method is defined in SessionFacadeBean (just like the EJB in SRDemo),
    I want the above 2 procedures executed in 1 transaction. If spc2 failed, the spc1 should not be committed. How can I do this?
    Regards,
    Jason
    Message was edited by:
    Jason.Lu

    I have changed code as follows:
    public void method1(){
    DatabaseSession session = getSessionFactory().getSharedSession();
    session.beginTransaction();
    try{
    StoredProcedureCall spc1 = new StoredProcedureCall();
    spc1.setProcedureName("PKG.SP1");
    spc1.addNamedArgumentValue("param", "aaa");
    session.executeNonSelectingCall(spc1);
    StoredProcedureCall spc2 = new StoredProcedureCall();
    spc2.setProcedureName("PKG.SP2");
    spc2.addNamedArgumentValue("param", "bbb");
    session.executeNonSelectingCall(spc2);
    } catch (Exception e) {
    session.rollbackTransaction();
    } finally {
    session.release();
    It seems that the "session.rollbackTransaction();" will be executed if spc2 fails.
    toplink logs are as follows:
    [TopLink Info]: 2007.11.12 10:20:36.690--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--default login successful
    [TopLink Finer]: 2007.11.12 10:20:36.690--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--TX beginTransaction, status=NO_TRANSACTION
    [TopLink Finer]: 2007.11.12 10:20:36.705--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--TX Internally starting
    [TopLink Finer]: 2007.11.12 10:20:36.705--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--external transaction has begun internally
    [TopLink Fine]: 2007.11.12 10:20:36.705--ServerSession(1901666)--Connection(11203640)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--BEGIN PKG.SP1(param=>'aaa'); END;
    [TopLink Fine]: 2007.11.12 10:20:36.971--ServerSession(1901666)--Connection(22861541)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--BEGIN PKG.SP2(param=>'bbb'); END;
    [TopLink Warning]: 2007.11.12 10:20:37.440--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SP2'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    [TopLink Finer]: 2007.11.12 10:20:37.455--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--TX rollbackTransaction, status=STATUS_ACTIVE
    [TopLink Finer]: 2007.11.12 10:20:37.455--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--TX Internally rolling back
    [TopLink Finer]: 2007.11.12 10:20:37.455--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--external transaction has rolled back internally
    The problem is the 1st store procedure is committed (it should be rolled back!), and the database is updated.
    Thanks,
    Jason

  • Can't execute Sybase store procedure

    Hi All,
    I'm trying to execute sybase store procedure, but somehow the procedure not executing. if any body what's the problem? I'm using JBoss server
    Code:
    public void deleteRigMapSP(String pMappingID, String rigid, String date,String pPhysicalDel, String database) throws DataAccessException {
    GregorianCalendar val = new GregorianCalendar();
    DateFormatter dateform = new DateFormatter();
    String deletiondate = dateform.convertGregorianToString(val);
    query = new StringBuffer("EXECUTE spRR_STAT_DeleteMapping ");
    query.append("'"+pMappingID + "',");
    query.append(null + ",");
    query.append(null + ",");
    query.append(null + ",");
    query.append(null + ",");
    query.append(null + ",");
    query.append(null + ",");
    query.append("'"+deletiondate + "',");
    query.append(pPhysicalDel);
    System.out.println("query: "+query);
    try {
         getDBConnection(ServiceLocator.getInstance().getDataSource(database));
         CallableStatement cs = dbConnection.prepareCall(query.toString());
    if (cs.execute()) {
              System.out.println("deleted");
         } else {
              System.out.println("not deleted");
    When I try to execute the method it's run fine, but it not executing the procedure.
    Any help will be greately appreciated.

    How do you know it's not executing? Maybe you're in manual transaction mode and you're not committing the transaction before you close the connection and it gets rolled back.
    And why on earth are you using CallableStatement if you're embedding the parameters into the SQL query rather than using placeholders and the setXXX() methods?
    Alin.

  • Execute exp&imp command by store procedure

    Dear all,
    I have some statements to run before and after exp&impdata.
    Is there anyway to execute exp&imp command in store procedure,Pls show me.
    example
    CREATE OR REPLACE PROCEDURE test
    BEGIN
    update ....
    exp user/passwd ....
    delete ...
    END ;
    Oracle 10g on solaris10
    Thank you for advance
    Chara

    Hi,
    Since you are working with Oracle10gm you may check DBMS_DATAPUMP:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_datpmp.htm
    Or like any shell command, you can use java programs.
    Saad,
    http://saadnayef.blogspot.com

  • Execute a Store Procedure in AS400 from Oracle

    Hi..
    I need to invoke a Store Procedure AS/400 from my Oracle Database (Workflow Engine). . How Can do That ??
    Thank you

    Hi Peter,
    is the xml File available for the Orchestrator Runbook Service and the logon account?
    Or are you Running with Runbook tester? ->
    http://www.sc-orchestrator.eu/index.php/scoblog/99-functionality-differences-executing-a-runbook-with-runbook-tester
    Regards,
    Stefan
    www.sc-orchestrator.eu ,
    Blog sc-orchestrator.eu

Maybe you are looking for