The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT hecv.default_code_combination_id employee_default_account_id,
msi.expense_account
FROM hr_employees_current_v hecv,
mtl_system_items msi,
icx_shopping_carts isc,
icx_shopping_cart_lines iscl
WHERE msi.INVENTORY_ITEM_ID (+) = iscl.ITEM_ID
AND nvl(msi.ORGANIZATION_ID,
nvl(isc.DESTINATION_ORGANIZATION_ID,
iscl.DESTINATION_ORGANIZATION_ID)) =
nvl(isc.DESTINATION_ORGANIZATION_ID,
iscl.DESTINATION_ORGANIZATION_ID)
AND hecv.EMPLOYEE_ID = v_emp_id
AND iscl.cart_id = v_cart_id
AND iscl.cart_line_id = v_cart_line_id
AND nvl(isc.org_id, -9999) = nvl(v_oo_id, -9999)
AND nvl(iscl.org_id, -9999) = nvl(v_oo_id, -9999);
SELECT CHART_OF_ACCOUNTS_ID
FROM gl_sets_of_books,
financials_system_parameters fsp
WHERE gl_sets_of_books.SET_OF_BOOKS_ID = fsp.set_of_books_id;
IF ak_query_pkg.g_items_table(i).update_flag = 'Y' THEN
IF ak_query_pkg.g_items_table(i).attribute_code = 'ICX_PERCENTAGE' THEN
IF v_display_first = ak_query_pkg.g_items_table(i).attribute_code THEN
htp.tableData(cvalue => '', crowspan => 1);
END IF; /* update_flag = 'Y' */
IF ak_query_pkg.g_items_table(i).update_flag = 'Y' THEN
if ak_query_pkg.g_items_table(i).attribute_code = 'ICX_PERCENTAGE' then
if v_display_first = ak_query_pkg.g_items_table(i).attribute_code then
htp.tableData(cvalue => '', crowspan => 1);
END IF; /* update_flag = 'Y' */
IF ak_query_pkg.g_items_table(i).update_flag = 'Y' THEN
if ak_query_pkg.g_items_table(i).attribute_code = 'ICX_PERCENTAGE' then
if v_display_first = ak_query_pkg.g_items_table(i).attribute_code then
htp.tableData(cvalue => '', crowspan => 1);
END IF; /* update_flag = 'Y' */
SELECT COUNT(distribution_num)
FROM icx_req_cart_errors
WHERE cart_id = l_cart_id
AND cart_line_id = l_cart_line_id
AND distribution_num IS NOT NULL;
select ltrim(rtrim(a.ATTRIBUTE_CODE)) ATTRIBUTE_NAME
from ak_region_items a,
ak_attributes b,
ak_regions c,
ak_object_attributes d
where a.NODE_DISPLAY_FLAG = 'Y'
and a.ATTRIBUTE_CODE = b.ATTRIBUTE_CODE
and a.ATTRIBUTE_APPLICATION_ID = b.ATTRIBUTE_APPLICATION_ID
and b.DATA_TYPE = 'VARCHAR2'
and c.REGION_APPLICATION_ID = 601
and a.REGION_CODE = c.REGION_CODE
and a.REGION_APPLICATION_ID = c.REGION_APPLICATION_ID
and c.DATABASE_OBJECT_NAME = d.DATABASE_OBJECT_NAME
and a.ATTRIBUTE_CODE = d.ATTRIBUTE_CODE
and a.region_code = 'ICX_CART_LINE_DISTRIBUTIONS_R'
and a.ATTRIBUTE_CODE LIKE 'ICX_CHARGE_ACCT_SEG%'
order by a.display_sequence;
select 1
from ak_region_items a,
ak_attributes b,
ak_regions c,
ak_object_attributes d
where a.NODE_DISPLAY_FLAG = 'Y'
and a.ATTRIBUTE_CODE = b.ATTRIBUTE_CODE
and a.ATTRIBUTE_APPLICATION_ID = b.ATTRIBUTE_APPLICATION_ID
and b.DATA_TYPE = 'VARCHAR2'
and c.REGION_APPLICATION_ID = 601
and a.REGION_CODE = c.REGION_CODE
and a.REGION_APPLICATION_ID = c.REGION_APPLICATION_ID
and c.DATABASE_OBJECT_NAME = d.DATABASE_OBJECT_NAME
and a.ATTRIBUTE_CODE = d.ATTRIBUTE_CODE
and a.region_code = 'ICX_CART_LINE_DISTRIBUTIONS_R'
and a.attribute_code = 'ICX_CHARGE_ACCOUNT_NUM';
DELETE FROM icx_req_cart_errors
WHERE cart_id = v_cart_id
AND cart_line_id = v_cart_line_id
AND distribution_num IS NOT NULL;
Delete all the distributions in the table. This need to be done to
take care of the deletion option. As we don't provide delete button option
the user will either enter '0' (zero) or leave blank in the percentage
column to indicate that, account entry is deleted.
*/
DELETE FROM icx_cart_line_distributions
WHERE cart_id = v_cart_id
AND cart_line_id = v_cart_line_id;
icx_req_acct2.update_account( v_cart_line_id => v_cart_line_id,
v_oo_id => v_org_id,
v_cart_id => v_cart_id,
v_segments => v_segment_value,
v_allocation_type => v_allocation_type,
v_allocation_value => to_number(icx_percentage(i)));
icx_req_acct2.update_account_num( v_cart_line_id => v_cart_line_id,
v_oo_id => v_org_id,
v_cart_id => v_cart_id,
v_account_num => icx_charge_account_num(i),
v_allocation_type => v_allocation_type,
v_allocation_value => to_number(icx_percentage(i)));
SELECT ltrim(rtrim(a.ATTRIBUTE_CODE)) ATTRIBUTE_NAME,
a.UPDATE_FLAG UPDATE_FLAG
FROM ak_region_items a,
ak_attributes b,
ak_regions c
WHERE a.NODE_DISPLAY_FLAG = 'Y'
AND a.ATTRIBUTE_CODE = b.ATTRIBUTE_CODE
AND a.ATTRIBUTE_APPLICATION_ID = b.ATTRIBUTE_APPLICATION_ID
AND b.DATA_TYPE = 'VARCHAR2'
AND c.REGION_APPLICATION_ID = 601
AND a.REGION_CODE = c.REGION_CODE
AND a.REGION_APPLICATION_ID = c.REGION_APPLICATION_ID
AND a.REGION_CODE = 'ICX_CART_LINE_DISTRIBUTIONS_R'
AND a.ATTRIBUTE_CODE LIKE 'ICX_CHARGE_ACCT_SEG%'
ORDER BY a.display_sequence;
SELECT cart_line_id
FROM icx_shopping_cart_lines
WHERE cart_id = v_cart_id
AND cart_line_id <> v_cart_line_id;
SELECT distribution_id
FROM icx_cart_line_distributions
WHERE cart_id = v_cart_id
AND cart_line_id = v_cart_line_id;
SELECT charge_account_num, allocation_value, allocation_type
FROM icx_cart_line_distributions
WHERE cart_id = v_cart_id
AND cart_line_id = v_cart_line_id;
SELECT 1
FROM ak_region_items a,
ak_attributes b,
ak_regions c,
ak_object_attributes d
WHERE a.NODE_DISPLAY_FLAG = 'Y'
AND a.ATTRIBUTE_CODE = b.ATTRIBUTE_CODE
AND a.ATTRIBUTE_APPLICATION_ID = b.ATTRIBUTE_APPLICATION_ID
AND b.DATA_TYPE = 'VARCHAR2'
AND c.REGION_APPLICATION_ID = 601
AND a.REGION_CODE = c.REGION_CODE
AND a.REGION_APPLICATION_ID = c.REGION_APPLICATION_ID
AND c.DATABASE_OBJECT_NAME = d.DATABASE_OBJECT_NAME
AND a.ATTRIBUTE_CODE = d.ATTRIBUTE_CODE
AND a.region_code = 'ICX_CART_LINE_DISTRIBUTIONS_R'
AND a.attribute_code = 'ICX_CHARGE_ACCOUNT_NUM';
DELETE FROM icx_cart_line_distributions
WHERE cart_id = v_cart_id
AND cart_line_id <> v_cart_line_id;
segments with the actual segment value later. The update flag is updated
Y in the pl/sql table record to indicate whether the default account need to
be inherited from the line default.
*/
l := 1;
v_ak_segments(l).update_flag := ak_col.update_flag;
IF v_ak_segments(l).update_flag = 'Y' THEN
v_line_segments(l) := v_segment_value(l);
icx_req_acct2.update_account( v_cart_line_id => req_line.cart_line_id,
v_oo_id => v_org_id,
v_cart_id => v_cart_id,
v_segments => v_line_segments,
v_allocation_type => v_allocation_type,
v_allocation_value => v_allocation_value,
v_validate_flag => 'N');
updateability of the segments, we are going to copy over the
current distribution's segments to all the lines.
**/
l := 1;
/** Insert the distribution **/
icx_req_acct2.update_account( v_cart_line_id => req_line.cart_line_id,
v_oo_id => v_org_id,
v_cart_id => v_cart_id,
v_segments => v_line_segments,
v_allocation_type => v_allocation_type,
v_allocation_value => v_allocation_value,
v_validate_flag => 'N');
icx_req_acct2.update_account_num(v_cart_line_id => req_line.cart_line_id,
v_oo_id => v_org_id,
v_cart_id => v_cart_id,
v_account_num => prec.charge_account_num,
v_allocation_type => prec.allocation_type,
v_allocation_value => prec.allocation_value,
v_validate_flag => 'N');
SELECT error_text
FROM icx_req_cart_errors
WHERE cart_id = v_cart_id
AND cart_line_id = v_cart_line_id
AND distribution_num IS NOT NULL;