ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrew.sc...@jpmchase.com
Subject Re: SQLMaps - Sybase and stored procedures
Date Tue, 09 Aug 2005 14:51:20 GMT
Yes, my code is currently:

HashMap map = new HashMap();
map.put("from_text", "Computers");
map.put("language", "FRE");
map.put("to_text", "");

results = (ArrayList) sqlMap.queryForList("testLanguageLookup", map);
iter = results.iterator();
System.out.println("results = " + results.toString());

and my sqlmap config:

<parameterMap id="languageLookupMap" class="java.util.HashMap">
      <parameter javaType="java.lang.String" mode="IN" jdbcType="VARCHAR"
property="from_text"/>
      <parameter javaType="java.lang.String" mode="IN" jdbcType="VARCHAR"
property="language"/>
      <parameter javaType="java.lang.String" mode="OUT" jdbcType="VARCHAR"
property="to_text"/>
</parameterMap>
<procedure id="testLanguageLookup"  parameterMap="languageLookupMap"
resultClass="java.lang.String">
      {call language_lookup @from_text = ?, @language = ?, @to_text = ?}
</procedure>


I have also tried : {call language_lookup (?,?,?)}


andy







                                                                                         
                                                  
                      Koka                                                               
                                                  
                      <226057@gmail.com        To:       user-java@ibatis.apache.org  
                                                     
                      >                        cc:                                    
                                                     
                                               Subject:  Re: SQLMaps - Sybase and stored procedures
                                        
                      09/08/2005 15:44                                                   
                                                  
                      Please respond to                                                  
                                                  
                      user-java                                                          
                                                  
                                                                                         
                                                  
                                                                                         
                                                  




Did you also put "to_text" into your Map? Say

HashMap map = new HashMap();
map.put("from_text", "Computers");
map.put("language", "FRE");
map.put("to_text", "FRE");

Actual value for to_text is irrelevant as it will be overwritten by
the return value after running proc.

Koka




Mime
View raw message