Skip to Content
author's profile photo Former Member
Former Member

Data integrator Sybase stored procedure calls

I'm using Data Integrator 11.7 and need to make a call to a Sybase ASE 12.5 stored procedure before starting an extract from taht database.

The Sybase procedure has the following header:

CREATE PROCEDURE pPublDWHProceedExtract (

@tablenamevc varchar(30) = 'all',

@action varchar(30),

@schedule int,

@offset int = 0,

@valid int output)

I need to retrieve the @valid return value before initiating the transfer.

When I import the procedure into DI, the @valid parameter appeard as an input parameter and I cannot get it's return value from a function call. If I try to use the SQL function, I get a Sybase error: This routine cannot be called until all fetchable results have been completely processed.

The sql function call looks like this:

sql('s4m_dwh_syb_ds', 'SET NOCOUNT ON' || chr(13) || 'declare @myvalid int' || chr(13) || 'exec pPublDWHProceedExtract @tablenamevc = \'all\', @action = \'begin\', @schedule = 0, @valid = @myvalid output' || chr(13) ||'select @myvalid');

How should I be calling this function?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2009 at 08:14 PM

    I found the solution after hours of testing.

    In order for Data Integrator to recognize the proper INPUT and OUTPUT status of stored procedures on Sybase, the procedures must be defined with no brackets ( ) around the parameters

    Example:

    CREATE PROCEDURE pPublDWHProceedExtract

    @tablenamevc varchar(30) = 'all',

    @action varchar(30),

    @schedule int,

    @offset int = 0,

    @valid int output

    instead of

    CREATE PROCEDURE pPublDWHProceedExtract (

    @tablenamevc varchar(30) = 'all',

    @action varchar(30),

    @schedule int,

    @offset int = 0,

    @valid int output)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.