Excel generate SQL use

 

 

 

="INSERT INTO SFA_SYS_CODE(CD_CTRY_CODE,CD_TYPE,CD_CODE,CD_DESC,CD_BACKEND_IND,DATETIMESTAMP) VALUES('MYS','COUNTRY','"&B2&"','"&A2&"','N',current timestamp);"

 

=CONCATENATE(CONCATENATE("DELETE FROM SFA_SYS_CODE WHERE CD_CTRY_CODE = 'MYS' AND CD_TYPE = 'NEW_COUNTRY' AND CD_CODE = '", B1, "';
"), CONCATENATE("INSERT INTO SFA_SYS_CODE(CD_CTRY_CODE, CD_TYPE, CD_CODE, CD_DESC, CD_BACKEND_IND, DATETIMESTAMP) VALUES('MYS', 'NEW_COUNTRY', '", CONCATENATE(B1&"','"&A1), "', 'N', current timestamp);"))

 

=RIGHT(C2,4)

=E2&" "&F2

=IF(LEN(B2)=1,"occupation.000"&B2,IF(LEN(B2)=2,"occupation.00"&B2,IF(LEN(B2)=3,"occupation.0"&B2,IF(LEN(B2)=4,"occupation."&B2))))

 

你可能感兴趣的:(Excel)