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.
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:
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:
you can find many example in the book squg.pdf which is provided with ASE CD books.