请教老师botp自定义函数如何写? 我写了这个:
java.lang.StringBuffer sql = new java.lang.StringBuffer();
sql.append("select ");
sql.append( "FSupplier");
sql.append(" from ");
sql.append( "T_BD_MaterialPurchasing");
sql.append(" where ");
sql.append("FOrgUnit='"+ FOrgUnit +"' and FMaterialID='"+ FMaterialID +"'" );
java.sql.Connection con = com.kingdee.bos.framework.ejb.EJBFactory.getConnection(__bosContext);
java.sql.Statement batchStatement = con.createStatement( );
java.sql.ResultSet rst = batchStatement.executeQuery(sql.toString( ));
String re = "";
while (rst.next( ))
{
rst.getString("FSupplier").toString();
//do sth
}
com.kingdee.util.db.SQLUtils.cleanup(batchStatement , con );
com.kingdee.util.db.SQLUtils.cleanup( con );
return re;
测试时,提示:
执行成功;
;
这是什么原因?
推荐阅读