Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006

    Unanswered: Composing a Sybase stored procedure that's Crystal Reports compatible


    I'm looking for an example or a tutorial that shows a Sybase stored procedure that's Crystal Reports compatible. If you know of one I'd appreciate hearing about it. Crystal Reports have a nice example for Oracle, but evidently not for Sybase.

    Crystal Reports requires that the stored procedure have a only one "Outputted Select" (whatever that is) and that is not return anything.

    I'm tasked with re-engineering a Crystal Reports report that uses several Sybase stored procedures (about 750 lines each) that seem to break these rules, (then again it could be my lack of experience that makes it seem that way) and I'm just trying to get some kind of a handle on how to proceed.

    Thanks in advance for any references.


  2. #2
    Join Date
    Jul 2006
    Crystal report use stored procedure that return result sets, like any select query.
    I mean, let last statement of your stored procedure is a select statement.
    do not use output parameters.

    -- this is just a demo example
    create procedure testme
    -- declare your variables that may be used in your logic
    declare @lastname varchar(20)
    declare @qty int

    -- process your business logic, whatever details is, reteriving data from tables,....
    -- e.g. setting the local variables
    select @lastname ="aaaaaaa"
    select @qty = 555

    -- last statement is select
    select @lastname as lastname , @qty as Quantity

    testing the procedure
    you must run and debug the stored procedure using any client tool ,e.g. SQL advantage which is provided by SYBASE.
    if its result is ok , you can use it safely in crystal report
    results of that stored procedure is:

    lastname Quantity
    aaaaaaa 555

    that result is displayed in the crystal report.
    I suggest that you test and debug your 750 lines procedure in sql advantage tool before using it in crystal report , modify it by avoiding output parameters , and let last select statement as:
    select @myoutputparameter

    you can find many example in the book squg.pdf which is provided with ASE CD books.

    M. Hassan
    Last edited by moh_hassan20; 07-09-06 at 03:51.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts