addDefaultValue columnName="CONSTANT_EVENT_TYPE_REF" tableName="TB_INVOICE_CYCLE" defaultValueComputed="(SELECT autoid FROM tb_constants c WHERE c.id='1' AND c.constant_type_ref=(select autoid FROM tb_constant_types WHERE id ='EVENT_TYPE'))"
addDefaultValue columnName="CONSTANT_EVENT_TYPE_REF" tableName="TB_INVOICE_CYCLE" defaultValueComputed="(SELECT autoid FROM tb_constants c WHERE c.id='1' AND c.constant_type_ref=(select autoid FROM tb_constant_types WHERE id ='EVENT_TYPE'))"
I would rewrite query as a join of TB_CONSTANTS and TB_CONSTANT_TYPES tables - don't see a reason for the inline view.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Bookmarks