cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Konovalov <oleg...@yahoo.com>
Subject Reading Output params from Stored Proc in sitemap
Date Wed, 04 Oct 2006 20:15:19 GMT
Hi,


I have 2 output parameters in stored procedure named ‘roster_id’ and 
‘error_text’ (the stored procedure is executed from create_wip_roster-query2.xml).

If the ‘error_text’ is populated 
then redirect page to ‘upload_wip_form’ along with the error_text 
value.

If the ‘error_text’ is not populated 
then redirect the page to ‘wip_roster’ form along with the ‘roster_id’ 
value.



For some reason I can not get obtain any parameters from stored procedure for executing correct
redirect.  

 

sitemap 
entry:

                                    
<map:match 
pattern="mbr/create_wip_roster">

                                                
<map:act type="request">

                                                            
<map:parameter name="parameters" value="true"/>

                                                            
<map:generate src="xml/create_wip_roster-query2.xml"/>

                                                            
<!-- this xml doc executes a 
procedure and gives out two output parameters named roster_id and error_text 
-->

                                                            
<map:transform type="sql">

                                                                        
<map:parameter name="company_number" value="{company_number}"/>
                                                                        
<map:parameter name="use-connection" value="db_conn"/>

                                                            
</map:transform>

                                                            
<!-- Here I want to check 
if the error_text is populated then redirect to upload_wip_form, 



                                                                   if not, then redirect to
wip_roster does not work. -->

                                                            
<map:select type="parameter">

                                                                        
<map:parameter name="error_text" value="{error_text}"/>

                                                                        
<map:when test="$error_text">

                                                                                    
<map:redirect-to uri="upload_wip_form?error_text={error_text}"/>

                                                                        
</map:when>

                                                                        
<map:otherwise>

                                                                        
<map:parameter name="roster_id" value="{roster_id}"/>

                                                                                    
<map:redirect-to uri="wip_roster"/>

                                                                        
</map:otherwise>

                                                            
</map:select>

                                                            
<map:serialize type="html"/>

                                                
</map:act>

                                    
</map:match>

 

    <content>        
        <sql:execute-query>
            <sql:query name="roster" isstoredprocedure="true">
                 begin mySP (<sql:substitute-value sql:name="company_number"/>,?,?);end;

            </sql:query>
            <sql:out-parameter sql:nr="1" sql:name="roster_id" sql:type="oracle.jdbc.driver.OracleTypes.NUMBER"/>
            <sql:out-parameter sql:nr="2" sql:name="error_text" sql:type="java.sql.Types.VARCHAR"/>
        </sql:execute-query>
    </content>
</page>


 

Sorry for the newbie question.
 
Thank you in advance,
Oleg.


Mime
View raw message