groovy:品號編碼
Callout
============
import java.sql.Timestamp
import java.math.BigDecimal
import java.sql.PreparedStatement
import java.sql.ResultSet
import org.compiere.util.DB
import org.compiere.model.MUser
//@script:groovy:getQuotationForOrder
if (A_Value == null )
A_Tab.setValue("編碼",null);
else
{
int id = ((Integer) A_Value).intValue();
String sql ="SELECT \"編碼\" FROM \"品號編碼明細\" WHERE \"品號編碼明細_id\"=? ";
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, id);
ResultSet rs = pstmt.executeQuery();
// 只作 1筆 while (rs.next()){
if (rs.next()) {
if (rs.getString("編碼") != null) A_Tab.setValue("編碼",rs. getString ("編碼"));
}
rs.close();
pstmt.close();
}
result=""
沒有留言:
張貼留言