2012年11月19日 星期一
groovy:ImportData
import groovy.sql.Sql
import java.sql.Timestamp
// sqlinformix = Sql.newInstance('jdbc:informix-sqli://192.168.170.211:1534/hisipddb:informixserver=hisipdsrv','informix','db@w94u6', 'com.informix.jdbc.IfxDriver' )
// sqlOracle = Sql.newInstance( 'jdbc:oracle:thin:@192.168.170.251:1521:orcl', 'adempiere','adempiere','oracle.jdbc.OracleDriver' )
//"jdbc:postgresql://hostname:port/dbname","username", "password");
sqlPostgres=Sql.newInstance('jdbc:postgresql://192.168.0.101:5433/adempiere', "adempiere", "adempiere","org.postgresql.Driver")
def m_created = new Timestamp(System.currentTimeMillis())
def table_id=0
def v_IsActive="Y"
sqlPostgres.eachRow( 'SELECT * FROM ADEMPIERE.M_Product' )
{
table_id=table_id+1
println "$it.Value -- ${it.Name} --"
sqlPostgres.execute(
'INSERT INTO ADEMPIERE.M_Product_T(M_Product_T_ID,AD_Client_ID,AD_Org_ID,Updated, UpdatedBy,Created,CreatedBy, IsActive,M_Product_ID,Value,Name,Description,C_UOM_ID,M_Product_Category_ID,C_TaxCategory_ID)'
+'VALUES ( ?, 11, 11, now(), 0, now(), 0, ?, ?, ?, ?, ?,?,?,? )' ,
[table_id, v_IsActive, it.M_Product_ID,it.Value,it.Name,it.Description,it.C_UOM_ID,it.M_Product_Category_ID,it.C_TaxCategory_ID] )
}
result=""
訂閱:
張貼留言 (Atom)
網誌存檔
-
▼
2012
(14)
-
▼
11月
(13)
- MTL_SAFETY_STOCKS 沒有 '04G185009492'
- SAP: OKOK
- groovy:ImportData
- 如何將文字串 output 到 cvs
- xxapsp0058
- 超越 Oracle EBS MRP 重寫中
- 超越 Oracle EBS
- OE_ORDER_LINES_ALL FLOW_STATUS_CODE
- -- Albert 出招-- -- 如何調教出 超越 Oracle EBS MRP --SE...
- APPS.XXAPSP0058_PKG
- CUX.XX_APSP0058
- CREATE TABLE CUX.XX_APS_ITEM_ORG_TMP
- CREATE TABLE CUX.XX_APS_ITEM_CONFIG
-
▼
11月
(13)

沒有留言:
張貼留言