fix the error with PostgreSQL when import translation, now the sql do not modify

sql = "INSERT INTO AD_Message (msgtext) VALUES ('{0} Linea(s) {1,number,#,##0.00}  - Total: {2,number,#,##0.00}')";
This commit is contained in:
vpj-cd 2007-01-12 20:13:28 +00:00
parent 3e5719cd3d
commit a332628303
3 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,8 @@ public final class ConvertMap_PostgreSQL {
// Oracle Pattern Replacement
// Data Types
s_pg.put("\\bNUMBER\\b", "NUMERIC");
s_pg.put("\\b NUMBER \\b", " NUMERIC ");
s_pg.put("\\b NUMBER(\\b", " NUMERIC(");
s_pg.put("\\bDATE\\b", "TIMESTAMP");
s_pg.put("\\bVARCHAR2\\b", "VARCHAR");
s_pg.put("\\bNVARCHAR2\\b", "VARCHAR");

View File

@ -154,9 +154,8 @@ public class Convert_PostgreSQL extends Convert_SQL92 {
}
retVars.addElement(new String(m.replaceAll("<-->")));
// end e-evolution vpj-cd 26.09.2005*/
String regex = (String) iter.next();
String replacement = (String) m_map.get(regex);
String replacement = (String) m_map.get(regex);
try {
// begin e-evolution vpj-cd 29.09.2005
// Pattern p = Pattern.compile(regex, REGEX_FLAGS );

View File

@ -167,6 +167,10 @@ public final class Convert_PostgreSQLTest {
r = convert.convert(sql);
verify(sql, r, "UPDATE T_InventoryValue SET PricePO = (SELECT currencyConvert (po.PriceList,po.C_Currency_ID,T_InventoryValue.C_Currency_ID,T_InventoryValue.DateValue,null, po.AD_Client_ID,po.AD_Org_ID) FROM M_Product_PO po WHERE po.M_Product_ID=T_InventoryValue.M_Product_ID AND po.IsCurrentVendor='Y' LIMIT 1 ), PriceList = (SELECT currencyConvert(pp.PriceList,pl.C_Currency_ID,T_InventoryValue.C_Currency_ID,T_InventoryValue.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID) FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp WHERE pp.M_Product_ID=T_InventoryValue.M_Product_ID AND pp.M_PriceList_Version_ID=T_InventoryValue.M_PriceList_Version_ID AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID AND plv.M_PriceList_ID=pl.M_PriceList_ID), PriceStd = (SELECT currencyConvert(pp.PriceStd,pl.C_Currency_ID,T_InventoryValue.C_Currency_ID,T_InventoryValue.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID) FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp WHERE pp.M_Product_ID=T_InventoryValue.M_Product_ID AND pp.M_PriceList_Version_ID=T_InventoryValue.M_PriceList_Version_ID AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID AND plv.M_PriceList_ID=pl.M_PriceList_ID), PriceLimit = (SELECT currencyConvert(pp.PriceLimit,pl.C_Currency_ID,T_InventoryValue.C_Currency_ID,T_InventoryValue.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID) FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp WHERE pp.M_Product_ID=T_InventoryValue.M_Product_ID AND pp.M_PriceList_Version_ID=T_InventoryValue.M_PriceList_Version_ID AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID AND plv.M_PriceList_ID=pl.M_PriceList_ID)");
sql = "INSERT INTO AD_Message (msgtext) VALUES ('{0} Linea(s) {1,number,#,##0.00} - Total: {2,number,#,##0.00}')";
r = convert.convert(sql);
verify(sql, r, "INSERT INTO AD_Message (msgtext) VALUES ('{0} Linea(s) {1,number,#,##0.00} - Total: {2,number,#,##0.00}')");
}
private void verify(String original, String[] converted, String expected) {