The following lines contain the word 'select', 'insert', 'update' or 'delete':
const_context_selection CONSTANT PLS_INTEGER := 8;
const_valuetype_selection CONSTANT PLS_INTEGER := 3;
t_psn_minimumselected type_number_table;
t_psn_maximumselected type_number_table;
tl_id_path.DELETE;
l_psn_minimumselected type_number_table;
l_psn_maximumselected type_number_table;
SELECT ps_node_id, parent_id, item_id, minimum, maximum, name, intl_text_id, minimum_selected,
maximum_selected, ps_node_type, initial_value, virtual_flag, feature_type, bom_required_flag,
reference_id, persistent_node_id, effective_from, effective_until, effective_usage_mask,
effectivity_set_id, decimal_qty_flag, ib_trackable, accumulator_flag, initial_num_value,
instantiable_flag, shippable_item_flag, inventory_transactable_flag, assemble_to_order_flag,
serializable_item_flag, counted_options_flag, devl_project_id, domain_order,
reverse_connector_id, max_qty_per_option
BULK COLLECT INTO
l_psn_psnodeid, l_psn_parentid, l_psn_itemid, l_psn_minimum, l_psn_maximum, l_psn_name,
l_psn_intltextid, l_psn_minimumselected, l_psn_maximumselected, l_psn_psnodetype,
l_psn_initialvalue, l_psn_virtualflag, l_psn_featuretype, l_psn_bomrequiredflag,
l_psn_referenceid, l_psn_persistentnodeid, l_psn_effectivefrom, l_psn_effectiveuntil,
l_psn_effectiveusagemask, l_psn_effectivitysetid, l_psn_decimalqtyflag, l_psn_ibtrackable,
l_psn_accumulatorflag, l_psn_initialnumvalue, l_psn_instantiableflag, l_psn_shippableitemflag,
l_psn_invtransactflag, l_psn_atoflag, l_psn_serialitemflag, l_psn_countedoptionsflag,
l_psn_devlprojectid, l_psn_domainorder, l_psn_reverseportid, l_psn_maxqtyperoption
FROM cz_ps_nodes
WHERE deleted_flag = '0'
START WITH ps_node_id = p_component_id
CONNECT BY PRIOR deleted_flag = '0' AND PRIOR ps_node_id = parent_id;
t_psn_minimumselected ( v_index ) := l_psn_minimumselected ( i );
t_psn_maximumselected ( v_index ) := l_psn_maximumselected ( i );
SELECT devl_project_id INTO l_model_id
FROM cz_ps_nodes
WHERE deleted_flag = '0'
AND ps_node_id = l_psn_reverseportid ( i );
t_psn_minimumselected( v_index ) := l_psn_minimumselected( l_index );
t_psn_maximumselected( v_index ) := l_psn_maximumselected( l_index );
h_StringConstantHash.DELETE;
h_IntegerConstantHash.DELETE;
h_LongConstantHash.DELETE;
h_MaskConstantHash.DELETE;
h_DoubleConstantHash.DELETE;
h_MethodDescriptorHash.DELETE;
SELECT cz_fce_files_s.NEXTVAL INTO this_file_id FROM DUAL;
UPDATE cz_fce_files SET deleted_flag = '1'
WHERE component_id = p_component_id
AND fce_file_type = p_type;
DELETE FROM cz_fce_files
WHERE component_id = p_component_id
AND fce_file_type = p_type
AND segment_nbr = this_segment_nbr;
INSERT INTO cz_fce_files ( FCE_FILE_ID
, FCE_FILE_TYPE
, COMPONENT_ID
, SEGMENT_NBR
, FCE_FILE
, DELETED_FLAG
, DEBUG_FLAG
)
VALUES ( this_file_id
, p_type
, p_component_id
, this_segment_nbr
, l_loc
, '0'
, TO_CHAR ( p_debug_mode )
);
SELECT fce_file INTO l_fce_file FROM cz_fce_files
WHERE deleted_flag = '0'
AND component_id = p_component_id
AND fce_file_type = p_type
AND segment_nbr = segment_nbr_svp;
h_LocalVariableHash.DELETE(h_LocalVariableBackPtr( l_ptr ));
h_RegisterHash.DELETE;
SELECT name INTO l_name FROM cz_rp_entries
WHERE deleted_flag = '0'
AND object_type = 'PRJ'
AND object_id = t_psn_psnodeid ( p_index );
, p_minselected IN NUMBER
, p_maxselected IN NUMBER
, p_eff_from IN DATE
, p_eff_until IN DATE
, p_eff_mask IN VARCHAR2
) IS
l_id NUMBER := t_psn_psnodeid ( p_index );
push_integer_constant ( p_minselected );
push_integer_constant ( p_maxselected );
push_double_constant ( p_minselected );
push_double_constant ( p_maxselected );
t_acc_targets.DELETE ( target_count_svp + 1, t_acc_targets.COUNT );
t_argument_table ( h_parameter_stack.COUNT ).DELETE;
PROCEDURE any_option_selected IS
BEGIN
emit_invokevirtual ('ISetExprDef.card()');
END any_option_selected;
PROCEDURE all_options_selected ( p_card IN PLS_INTEGER ) IS
BEGIN
emit_invokevirtual ('ISetExprDef.card()');
END all_options_selected;
apply_bom_property ('IBomDef.selected()');
apply_bom_property ('IBomDef.selected()');
emit_invokevirtual ('IBomDef.selected()');
any_option_selected ();
ELSIF ( h_quantities.EXISTS ( p_template_id ) OR p_template_id = h_templates ('selectioncount')) THEN
IF ( l_is_bom or l_is_bomreference ) THEN
IF ( t_psn_psnodetype ( p_index ) <> h_psntypes ('bommodel')) THEN
--This call is required only if the property is not applied to the root bom model itself.
--If the property cannot be applied to the root model, this condition can be removed.
emit_dup ();
IF ( p_template_id = h_templates ('selectioncount') AND t_psn_countedoptionsflag ( p_index ) = '1' ) THEN
--Property is applied to a Counted Option Feature.
emit_invokevirtual ('IBagExprDef.count()');
IF ( l_is_bomreference AND ( h_quantities.EXISTS ( TO_CHAR ( p_template_id )) OR p_template_id = h_templates ('selectioncount'))) THEN
l_return := generate_path ( t_psn_referenceid ( l_index ), p_expl_id, p_input_context, x_output_context );
any_option_selected ();
all_options_selected ( h_psnid_numberofchildren ( l_node_id ));
SELECT persistent_intl_text_id, localized_str INTO l_id, l_text FROM cz_localized_texts
WHERE deleted_flag = '0' AND language = USERENV ('LANG') AND intl_text_id = this_reason_id;
IF ( p_input_context.context_type = const_context_selection ) THEN
--This literal partitipates in an expression involving Selection() with a text
--property. We just need to populate data structures that will be used in the
--Selection() generation.
l_count := s_.COUNT + 1;
, h_templates ('minselected')
, h_templates ('maxselected')
)
) THEN
x_data_type := h_datatypes ('decimal');
, h_templates ('minselected')
)
) THEN
l_value := t_psn_minimum ( l_index );
, h_templates ('maxselected')
)
) THEN
l_value := t_psn_maximum ( l_index );
SELECT NVL( TO_CHAR ( def_num_value ), def_value ), data_type INTO x_def_value, x_data_type
FROM cz_properties
WHERE property_id = p_property_id
AND deleted_flag = '0';
SELECT NVL ( TO_CHAR( data_num_value ), data_value ) BULK COLLECT INTO l_tab
FROM cz_ps_prop_vals
WHERE ps_node_id = p_node_id
AND property_id = p_property_id
AND deleted_flag = '0';
SELECT NVL( TO_CHAR ( property_num_value ), property_value ) BULK COLLECT INTO l_tab
FROM cz_item_property_values
WHERE property_id = p_property_id
AND item_id = p_item_id
AND deleted_flag = '0';
SELECT NULL BULK COLLECT INTO l_tab
FROM cz_item_type_properties t, cz_item_masters m
WHERE m.item_id = p_item_id
AND m.deleted_flag = '0'
AND t.deleted_flag = '0'
AND t.property_id = p_property_id
AND t.item_type_id = m.item_type_id;
PROCEDURE generate_selection_property ( j IN PLS_INTEGER
, p_property_id IN NUMBER
, p_input_context IN expression_context
, x_output_context IN OUT NOCOPY expression_context
) IS
l_return PLS_INTEGER;
any_option_selected ();
END generate_selection_property;
PROCEDURE generate_selection_object ( p_node_id IN NUMBER
, p_expl_id IN NUMBER
, p_data_type IN NUMBER
, p_property_values IN type_numbertable_hashtable
, p_input_context IN expression_context
, x_output_context IN OUT NOCOPY expression_context
) IS
l_return PLS_INTEGER;
p_text => GET_NOT_TRANSLATED_TEXT( CZ_FCE_SW_SELECT_PROP_NOTALLOW ),
p_warning_location => 'generate_selection_object');
END generate_selection_object;
generate_selection_object ( c_.participants ( p_side ).ps_node_id
, c_.participants ( p_side ).model_ref_expl_id
, h_datatypes ('text')
, t_property_values
, p_input_context, x_output_context );
PROCEDURE generate_selection ( j IN PLS_INTEGER
, p_property_id IN NUMBER
, p_input_context IN expression_context
, x_output_context IN OUT NOCOPY expression_context
) IS
l_property_id NUMBER := p_property_id;
p_text => GET_NOT_TRANSLATED_TEXT( CZ_FCE_SW_SELECT_PROP_NOTALLOW ),
p_warning_location => 'generate_selection');
p_warning_location => 'generate_selection');
generate_selection_property ( j, l_property_id, p_input_context, x_output_context );
p_text => GET_NOT_TRANSLATED_TEXT( CZ_FCE_SW_INVAL_SPROP_SELECT ),
p_warning_location => 'generate_selection');
IF ( l_data_type = h_datatypes ('text') OR p_input_context.context_type = const_context_selection ) THEN
--This will be 'text' selection, prepare the data structures.
l_side := s_.COUNT + 1;
p_warning_location => 'generate_selection');
generate_selection_object ( t_exp_psnodeid ( j )
, t_exp_modelrefexplid ( j )
, l_data_type
, t_property_values
, p_input_context, x_output_context );
END generate_selection;
SELECT data_type, mutable_flag, collection_flag INTO l_data_type, x_mutable, x_collection
FROM cz_signature_arguments
WHERE deleted_flag = '0'
AND argument_signature_id = p_signature_id
AND argument_index = p_arg_index;
SELECT NULL INTO l_null
FROM cz_rul_typedpsn_v psn,
cz_conversion_rels_v cnv,
cz_system_property_rels_v rel,
cz_system_properties_v sys,
cz_conversion_rels_v cnv2
WHERE psn.detailed_type_id = cnv.object_type
AND cnv.subject_type = rel.subject_type
AND rel.object_type = sys.rule_id
AND rel.rel_type_code = 'SYS'
AND sys.data_type = cnv2.object_type
AND psn.ps_node_id = p_ps_node_id
AND sys.rule_id = p_property_id
AND sys.mutable_flag >= l_mutable
--Note: Collection flag filter is removed, to allow rules like AddsTo(OptionFeature.options(), Total).
-- AND sys.collection_flag <= l_collection
AND cnv2.subject_type = l_data_type;
ELSIF ( t_exp_templateid ( l_index ) = h_templates ('selection')) THEN
l_index := l_index + 1;
generate_selection ( j, l_property_id, p_input_context, x_output_context );
t_acc_local_quantifiers.DELETE;
h_instancequantifiers.DELETE;
t_instancequantifiers.DELETE;
h_instancequantifiers.DELETE;
t_instancequantifiers.DELETE;
tl_excludes_id.DELETE;
tl_excludes.DELETE;
l_maximum := CASE is_bom_node ( l_index ) WHEN TRUE THEN t_psn_maximumselected ( l_index ) ELSE t_psn_maximum ( l_index ) END;
WHEN const_valuetype_selection THEN
t_exp_psnodeid ( j ) := l_parameter.ps_node_id;
generate_selection ( j, l_parameter.data_num_value, p_input_context, x_output_context );
t_children.DELETE;
ELSIF ( l_property_id = h_templates ('selection')) THEN
l_iterator ( l_count ).value_type := const_valuetype_selection;
c_.participants.DELETE;
c_.combinations.DELETE;
o_.DELETE;
n_.DELETE;
s_.DELETE;
t_.DELETE;
b_.DELETE;
c_.combinations.DELETE;
h_instancequantifiers.DELETE;
t_instancequantifiers.DELETE;
h_parameter_stack.DELETE ( l_count );
c_.participants.DELETE;
c_.combinations.DELETE;
o_.DELETE;
n_.DELETE;
s_.DELETE;
t_.DELETE;
b_.DELETE;
SELECT primary_opt_id, secondary_opt_id, secondary_feature_id, secondary_feat_expl_id
BULK COLLECT INTO tl_primaryoptid, tl_secondaryoptid, tl_featureid, tl_modelrefexplid
FROM cz_des_chart_cells
WHERE deleted_flag = '0'
AND rule_id = this_rule_id;
SELECT feature_id, model_ref_expl_id, feature_type
BULK COLLECT INTO tl_featureid, tl_modelrefexplid, tl_featuretype
FROM cz_des_chart_features
WHERE deleted_flag = '0'
AND rule_id = this_rule_id;
SELECT primary_opt_id, secondary_opt_id, secondary_feature_id, secondary_feat_expl_id
BULK COLLECT INTO tl_primaryoptid, tl_secondaryoptid, tl_secondaryfeatid, tl_secondaryfeatexplid
FROM cz_des_chart_cells
WHERE deleted_flag = '0'
AND rule_id = this_rule_id;
FUNCTION is_text_selection ( j IN PLS_INTEGER ) RETURN BOOLEAN IS
l_expr_id VARCHAR2(4000);
RETURN retrieve_parameter ( t_exp_argumentname ( j )).value_type = const_valuetype_selection;
IF ( NVL ( t_exp_templateid ( l_index ), 0 ) = h_templates ('selection')) THEN RETURN TRUE; END IF;
END is_text_selection;
l_lhs_selection BOOLEAN;
l_rhs_selection BOOLEAN;
t_acc_local_quantifiers.DELETE;
l_lhs_selection := is_text_selection ( l_index );
l_rhs_selection := is_text_selection ( l_aux );
IF (( l_lhs_selection AND t_exp_exprtype ( l_aux ) <> h_exprtypes ('literal')) OR
( l_rhs_selection AND t_exp_exprtype ( l_index ) <> h_exprtypes ('literal')))THEN
report_and_raise_rule_sys_warn(
CZ_UTILS.GET_TEXT(CZ_FCE_SW_COMPARE_TXPROP_TXLIT ),
'generate_expression' );
l_input_context.context_type := const_context_selection;
c_.combinations.DELETE;
c_.participants.DELETE;
o_.DELETE;
s_.DELETE;
t_.DELETE;
IF ( l_lhs_selection ) THEN l_side := 1;
ELSIF ( l_rhs_selection ) THEN l_side := 2; END IF;
SELECT ps_node_id, model_ref_expl_id, effective_from, effective_until
BULK COLLECT INTO l_node_id_tbl, l_expl_id_tbl, l_eff_from_tbl, l_eff_until_tbl
FROM cz_explmodel_nodes_v
WHERE model_id = p_component_id
AND parent_psnode_expl_id = p_expl_id
AND effective_parent_id = p_node_id
AND suppress_flag = '0'
AND name = l_node_tbl ( p_index );
SELECT model_ref_expl_id, parent_expl_node_id, component_id, referring_node_id, expl_node_type
BULK COLLECT INTO t_expl_modelrefexplid, t_expl_parentexplnodeid, t_expl_componentid,
t_expl_referringnodeid, t_expl_explnodetype
FROM cz_model_ref_expls
WHERE model_id = p_component_id
AND deleted_flag = '0';
FOR rule IN ( SELECT rule_id, rule_type, name, reason_id, rule_folder_id, component_id, model_ref_expl_id,
effective_from, effective_until, effective_usage_mask, effectivity_set_id, invalid_flag,
unsatisfied_msg_id, unsatisfied_msg_source, presentation_flag, rule_class, class_name
FROM cz_rules
WHERE devl_project_id = p_component_id
AND deleted_flag = '0'
AND disabled_flag = '0'
ORDER BY class_seq ) LOOP
BEGIN
this_rule_id := rule.rule_id;
t_exp_modelrefexplid.DELETE;
t_exp_exprtype.DELETE;
t_exp_exprnodeid.DELETE;
t_exp_exprparentid.DELETE;
t_exp_templateid.DELETE;
t_exp_psnodeid.DELETE;
t_exp_datavalue.DELETE;
t_exp_propertyid.DELETE;
t_exp_paramindex.DELETE;
t_exp_argumentindex.DELETE;
t_exp_argumentname.DELETE;
t_exp_datatype.DELETE;
t_exp_datanumvalue.DELETE;
t_exp_paramsignatureid.DELETE;
t_exp_relativenodepath.DELETE;
t_exp_seqnbr.DELETE;
h_exprid_childrenindex.DELETE;
h_exprid_numberofchildren.DELETE;
h_exprid_backindex.DELETE;
SELECT model_ref_expl_id, expr_type, expr_node_id, expr_parent_id, template_id, ps_node_id, data_value,
property_id, param_index, argument_index, argument_name, data_type, data_num_value,
param_signature_id, relative_node_path, seq_nbr
BULK COLLECT INTO t_exp_modelrefexplid, t_exp_exprtype, t_exp_exprnodeid, t_exp_exprparentid,
t_exp_templateid, t_exp_psnodeid, t_exp_datavalue, t_exp_propertyid,
t_exp_paramindex, t_exp_argumentindex, t_exp_argumentname, t_exp_datatype,
t_exp_datanumvalue, t_exp_paramsignatureid, t_exp_relativenodepath, t_exp_seqnbr
FROM cz_expression_nodes
WHERE rule_id = rule.rule_id
AND expr_type <> h_exprtypes ('punctuation')
AND deleted_flag = '0'
ORDER BY expr_parent_id, seq_nbr;
CZ_FCE_W_NODE_DELETED,
'NODE_NAME', CZ_FCE_COMPILE_UTILS.GET_NODE_PATH ( t_exp_psnodeid ( i ),
ps_node_id_table_to_string ( build_model_path ( t_exp_psnodeid ( i )))),
'RULE_NAME', CZ_FCE_COMPILE_UTILS.GET_RULE_PATH( this_rule_id, this_rule_name ),
'MODEL_NAME', CZ_FCE_COMPILE_UTILS.GET_MODEL_PATH ( p_component_id, p_model_path )),
p_warning_location => 'compile_constraints');
h_instancequantifiers.DELETE;
t_instancequantifiers.DELETE;
h_parameter_stack.DELETE;
l_var_max := NVL ( t_psn_maximumselected( v_index ), cz_fce_compile_utils.const_max_integer);
, NVL ( t_psn_minimumselected ( v_index ), 0 )
, NVL ( t_psn_maximumselected ( v_index ), cz_fce_compile_utils.const_max_integer)
, NVL ( t_psn_initialnumvalue ( v_index ), 0 )
, l_var_min
, l_var_max
, l_begin_date
, l_end_date
, LPAD ( t_psn_effectiveusagemask ( v_index ), 16, '0')
);
IF ( NVL ( t_psn_maximumselected ( v_index ), -1 ) = -1 ) THEN
l_var_max := h_psnid_numberofchildren ( TO_CHAR ( t_psn_psnodeid ( v_index )));
, NVL ( t_psn_minimumselected ( v_index ), 0 )
, l_var_max
, l_begin_date
, l_end_date
, LPAD ( t_psn_effectiveusagemask ( v_index ), 16, '0' )
);
l_var_max := NVL ( t_psn_maximumselected(v_index), cz_fce_compile_utils.const_max_integer);
, NVL ( t_psn_minimumselected(v_index), 0)
, NVL ( t_psn_maximumselected(v_index), cz_fce_compile_utils.const_max_integer)
, NVL ( t_psn_initialnumvalue(v_index), 0)
, l_var_min
, l_var_max
, l_begin_date
, l_end_date
, LPAD ( t_psn_effectiveusagemask ( v_index ), 16, '0' )
);
SELECT cz_xfr_run_infos_s.NEXTVAL INTO x_run_id FROM DUAL;
SELECT effectivity_set_id, effective_from, effective_until
BULK COLLECT INTO t_effset_effectivitysetid, t_effset_effectivefrom, t_effset_effectiveuntil
FROM cz_effectivity_sets
WHERE deleted_flag = '0';
h_devlid_modelvisited.DELETE;
h_devlid_modelvisited.DELETE;