Have a question about stored procedure:
How to retrieve the variable's value from stored procedure that is declared as an output variable.
Running procedure as :
EXEC pn_investment_type_eqt {args}
Here is stored procedure:
create proc pn_investment_type_eqt
(
@product_type varchar(10),
@country varchar(10),
@fi_treatment varchar(1)= '',
@investment_type varchar(10) output,
@investment_description varchar(50) output
)
as
set nocount on
if @country <> 'US'
select @country = 'FOREIGN'
if ( @fi_treatment not in ('Y','N') )
select @fi_treatment = 'N'
if not exists(select 1 from d_investment_type_eqt
where product_type = @product_type and isNull(country,'') = isNull(@country,'') and fi_treatment = @fi_treatment and row_status='A' )
begin
select @country = 'ANY'
end
if exists ( select 1 from d_investment_type_eqt
where product_type = @product_type and isNull(country,'') = isNull(@country,'') and fi_treatment = @fi_treatment and row_status='A' )
begin
select @investment_type= investment_type , @investment_description = description
from d_investment_type_eqt
where product_type = @product_type and isNull(country,'') = isNull(@country,'') and fi_treatment = @fi_treatment and row_status='A'
end
else
return (-1)
I need to get values of @investment_type & @investment_description.
I can't change procedure.
I am using a custom implementation of jdbcTemplate of Spring 2.0 (sql, mapper, args)
DB is Sybase
How could I get results from this stored procedure ?