Note that there are some explanatory texts on larger screens.

plurals
  1. POStored Procedure with parameters/variables - how to get result from procedure execution?
    text
    copied!<p>Have a question about stored procedure:<br> How to retrieve the variable's value from stored procedure that is declared as an output variable. Running procedure as :</p> <pre><code>EXEC pn_investment_type_eqt {args} </code></pre> <p>Here is stored procedure:</p> <pre><code>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 &lt;&gt; '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) </code></pre> <p><strong>I need to get values of @investment_type &amp; @investment_description.</strong></p> <p><strong>I can't change procedure.</strong></p> <p>I am using a custom implementation of jdbcTemplate of Spring 2.0 (sql, mapper, args)</p> <p>DB is Sybase</p> <p>How could I get results from this stored procedure ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload