Skip to content

Instantly share code, notes, and snippets.

@BalicantaYao
Last active August 29, 2015 14:07
Show Gist options
  • Save BalicantaYao/6047465335f8e14cbf56 to your computer and use it in GitHub Desktop.
Save BalicantaYao/6047465335f8e14cbf56 to your computer and use it in GitHub Desktop.
# For Using Gen Teda i18N
property_list = [1, 2, 3, 9, 10, 11]
i18n_key_value = {"PMS_PRICE_SIMU_MASTER.TYPE":"Simulation Type"}
template = """
MERGE INTO "DOTJ_PROPERTIES_CONTENT" proper
USING dual ON ("CONTENT_KEY" = '{CONTENT_KEY}' and "PROPERTIES_ID" = {prop_id})
WHEN MATCHED THEN
UPDATE SET proper.CONTENT_VALUE = '{CONTENT_VALUE}'
WHEN NOT MATCHED THEN
INSERT ("ID", "CREATED_TIME", "CREATOR", "MODIFIED_TIME", "VERSION_CONTROL", "CONTENT_KEY", "PROPERTIES_ID", "CONTENT_VALUE")
VALUES ((select max(id)+1 from DOTJ_PROPERTIES_CONTENT), '20141020 000000', 'eBizprise',
'20141020 000000', 0, '{CONTENT_KEY}', {prop_id}, '{CONTENT_VALUE}');"""
for key_value in i18n_key_value:
for proper_id in property_list:
param = {'prop_id': proper_id, 'CONTENT_KEY':key_value, 'CONTENT_VALUE':i18n_key_value[key_value]}
print template.format(prop_id = proper_id, CONTENT_KEY= key_value, CONTENT_VALUE=i18n_key_value[key_value])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment