update lang_messages
set sync_time = current_timestamp
where package_key = :package_key
and locale = :locale
select package_key
from apm_package_types
where exists (select 1
from apm_package_versions
where package_key = apm_package_types.package_key
and installed_p = 't'
and enabled_p = 't')
and not exists (select 1
from lang_message_keys
where package_key = apm_package_types.package_key)
select distinct locale
from lang_messages
where package_key = :package_key
select lm.message_key,
lm.message,
lmk.description
from lang_messages lm,
lang_message_keys lmk
where lm.message_key = lmk.message_key
and lm.package_key = lmk.package_key
and lm.package_key = :package_key
and lm.locale = :locale
and lm.deleted_p = 'f'
select message_key,
package_key,
message
from lang_messages lm1
where locale = :default_locale
and not exists (select message_key, package_key
from lang_messages lm2
where locale != :default_locale
and lm1.message_key = lm2.message_key
and lm1.package_key = lm2.package_key)