DBA Data[Home] [Help]

APPS.AK_QUERY_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 89

p_num_select			OUT NOCOPY number,
p_num_key			OUT NOCOPY number,
p_new_key_columns		OUT NOCOPY rel_key_tab,
p_rls_binds			OUT NOCOPY bind_tab,
p_select			OUT NOCOPY varchar2,
p_from			OUT NOCOPY varchar2,
p_where			OUT NOCOPY varchar2,
p_order_by			OUT NOCOPY varchar2
);
Line: 102

p_num_select        	        IN number,
p_num_key       	        IN number,
p_region_rec		        IN region_rec,
p_display_region	        IN boolean,
p_key_values			OUT NOCOPY rel_key_value_tab
);
Line: 112

p_num_select                  IN number
);
Line: 134

p_select			IN varchar2,
p_from			IN varchar2,
p_where			IN varchar2,
p_order_by			IN varchar2
);
Line: 208

num_select		        number  := 0;
Line: 225

g_regions_table.delete;
Line: 226

g_regions_bind_table.delete;
Line: 227

g_items_table.delete;
Line: 228

g_results_table.delete;
Line: 278

select ao.database_object_name, ao.primary_key_name
into root.database_object_name, root.primary_key_name
from ak_objects ao,
ak_regions ar
where ar.region_code = root.region_code
and   ar.region_application_id = root.region_application_id
and   ar.database_object_name = ao.database_object_name;
Line: 384

l_num_select			number := 0;
Line: 391

l_select			varchar2(10000);
Line: 421

l_num_select,
l_num_key,
l_key_columns,
l_rls_binds,
l_select,
l_from,
l_where,
l_order_by);
Line: 436

l_select,
l_from,
l_where,
l_order_by);
Line: 461

l_num_select,
l_num_key,
l_key_columns,
l_rls_binds,
l_select,
l_from,
l_where,
l_order_by);
Line: 476

l_select,
l_from,
l_where,
l_order_by);
Line: 500

ak_query_pkg.define_sql(cursor_id, l_num_select + l_num_key);
Line: 529

l_num_select,
l_num_key,
p_node,
p_display_region,
l_key_values);
Line: 611

SELECT afrr.foreign_key_name    foreign_key_name,
afk.unique_key_name      fk_unique_key_name,
afk.database_object_name fk_db_object_name,
afrr.from_page_appl_id   from_page_appl_id,
afrr.from_page_code      from_page_code,
afrr.from_region_appl_id from_region_appl_id,
afrr.from_region_code    from_region_code,
ar1.database_object_name from_db_object_name,
ao1.primary_key_name	    from_obj_unique_key,
decode(afpr1.display_sequence, null, 'N','Y') from_region_disp_flag,
afrr.to_page_appl_id     to_page_appl_id,
afrr.to_page_code        to_page_code,
afrr.to_region_appl_id   to_region_appl_id,
afrr.to_region_code      to_region_code,
ar2.database_object_name to_db_object_name,
ao2.primary_key_name     to_obj_unique_key,
decode(afpr2.display_sequence, null, 'N','Y') to_region_disp_flag,
decode(afpr2.display_sequence, null, 0 ,afpr2.display_sequence) disp_seq
FROM
ak_flow_region_relations afrr,
ak_regions ar1,
ak_regions ar2,
ak_flow_page_regions afpr1,
ak_flow_page_regions afpr2,
ak_objects ao1,
ak_objects ao2,
ak_foreign_keys afk
WHERE afrr.flow_application_id = flow_appl_id_param
AND afrr.flow_code = flow_code_param
AND afrr.from_page_appl_id = from_page_appl_id_param
AND afrr.from_page_code = from_page_code_param
AND afrr.from_region_appl_id = from_region_appl_id_param
AND afrr.from_region_code = from_region_code_param
AND afrr.to_page_appl_id = NVL(to_page_appl_id_param,afrr.to_page_appl_id)
AND afrr.to_page_code = NVL(to_page_code_param,afrr.to_page_code)
AND afrr.from_region_appl_id = ar1.region_application_id
AND afrr.from_region_code = ar1.region_code
AND afrr.to_region_appl_id = ar2.region_application_id
AND afrr.to_region_code = ar2.region_code
AND afrr.flow_application_id = afpr1.flow_application_id
AND afrr.flow_code = afpr1.flow_code
AND afrr.from_page_appl_id = afpr1.page_application_id
AND afrr.from_page_code = afpr1.page_code
AND afrr.from_region_appl_id = afpr1.region_application_id
AND afrr.from_region_code = afpr1.region_code
AND afrr.flow_application_id = afpr2.flow_application_id
AND afrr.flow_code = afpr2.flow_code
AND afrr.to_page_appl_id = afpr2.page_application_id
AND afrr.to_page_code = afpr2.page_code
AND afrr.to_region_appl_id = afpr2.region_application_id
AND afrr.to_region_code = afpr2.region_code
AND ar1.database_object_name = ao1.database_object_name
AND ar2.database_object_name = ao2.database_object_name
AND afrr.foreign_key_name = afk.foreign_key_name
ORDER BY disp_seq
;
Line: 729

p_num_select			OUT NOCOPY number,
p_num_key			OUT NOCOPY number,
p_new_key_columns		OUT NOCOPY rel_key_tab,
p_rls_binds			OUT NOCOPY bind_tab,
p_select			OUT NOCOPY varchar2,
p_from			OUT NOCOPY varchar2,
p_where			OUT NOCOPY varchar2,
p_order_by			OUT NOCOPY varchar2
)
IS

CURSOR select_cur
(
p_child_region_appl_id              NUMBER,
p_child_region_code                 VARCHAR2,
p_responsibility_id                 NUMBER
)
IS
-- Select region_items that are also object_attributes
SELECT aoa.column_name                      column_name,
ari.display_sequence                 display_sequence,
ari.attribute_application_id         attribute_application_id,
ari.attribute_code                   attribute_code,
decode(aei.attribute_code,NULL,'F','T')  secured_column,
decode(arsa.attribute_code,NULL,'F','T') rls_column,
decode(ari.icx_custom_call,'INDEX','T','F') indexed_column,
arit.attribute_label_long            attribute_label_long,
ari.attribute_label_length           attribute_label_length,
aa.attribute_value_length		attribute_value_length,
ari.display_value_length             display_value_length,
ari.item_style                       item_style,
ari.bold                             bold,
ari.italic                           italic,
ari.vertical_alignment               vertical_alignment,
ari.horizontal_alignment             horizontal_alignment,
ari.object_attribute_flag            object_attribute_flag,
ari.node_query_flag                  node_query_flag,
ari.node_display_flag                node_display_flag,
ari.update_flag                      update_flag,
ari.required_flag                    required_flag,
ari.icx_custom_call                  icx_custom_call,
aoa.validation_api_pkg               object_validation_api_pkg,
aoa.validation_api_proc              object_validation_api_proc,
aoa.defaulting_api_pkg               object_defaulting_api_pkg,
aoa.defaulting_api_proc              object_defaulting_api_proc,
ari.region_validation_api_pkg        region_validation_api_pkg,
ari.region_validation_api_proc       region_validation_api_proc,
ari.region_defaulting_api_pkg        region_defaulting_api_pkg,
ari.region_defaulting_api_proc       region_defaulting_api_proc,
ari.lov_foreign_key_name             lov_foreign_key_name,
ari.lov_region_application_id        lov_region_application_id,
ari.lov_region_code                  lov_region_code,
ari.lov_attribute_application_id     lov_attribute_application_id,
ari.lov_attribute_code               lov_attribute_code,
ari.lov_default_flag                 lov_default_flag,
ari.order_sequence			order_sequence,
ari.order_direction			order_direction,
aa.data_type				data_type
FROM  ak_object_attributes aoa,
ak_excluded_items aei,
ak_resp_security_attributes arsa,
ak_attributes aa,
ak_regions ar,
ak_region_items_tl arit,
ak_region_items ari
WHERE ari.object_attribute_flag = 'Y'
AND  aoa.attribute_application_id = ari.attribute_application_id
AND  aoa.attribute_code = ari.attribute_code
AND  aoa.database_object_name = ar.database_object_name
AND  ar.region_application_id = ari.region_application_id
AND  ar.region_code = ari.region_code
AND  ari.region_code = p_child_region_code
AND  ari.region_application_id = p_child_region_appl_id
AND  arit.region_code = ari.region_code
AND  arit.region_application_id = ari.region_application_id
AND  arit.attribute_code = ari.attribute_code
AND  arit.attribute_application_id = ari.attribute_application_id
AND  arit.language = userenv('LANG')
AND  aei.responsibility_id (+) = p_responsibility_id
AND  aei.attribute_application_id (+) = ari.attribute_application_id
AND  aei.attribute_code (+) = ari.attribute_code
AND  arsa.responsibility_id (+) = p_responsibility_id
AND  arsa.attribute_application_id (+) = ari.attribute_application_id
AND  arsa.attribute_code (+) = ari.attribute_code
AND  ari.attribute_code = aa.attribute_code
AND  ari.attribute_application_id = aa.attribute_application_id
UNION ALL
-- Select region_items that are not object attributes
SELECT null                                 column_name,
ari.display_sequence                 display_sequence,
ari.attribute_application_id         attribute_application_id,
ari.attribute_code                   attribute_code,
decode(aei.attribute_code,NULL,'F','T')  secured_column,
decode(arsa.attribute_code,NULL,'F','T') rls_column,
decode(ari.icx_custom_call,'INDEX','T','F') indexed_column,
arit.attribute_label_long            attribute_label_long,
ari.attribute_label_length           attribute_label_length,
aa.attribute_value_length		attribute_value_length,
ari.display_value_length             display_value_length,
ari.item_style                       item_style,
ari.bold                             bold,
ari.italic                           italic,
ari.vertical_alignment               vertical_alignment,
ari.horizontal_alignment             horizontal_alignment,
ari.object_attribute_flag            object_attribute_flag,
ari.node_query_flag                  node_query_flag,
ari.node_display_flag                node_display_flag,
ari.update_flag                      update_flag,
ari.required_flag                    required_flag,
ari.icx_custom_call                  icx_custom_call,
null                                 object_validation_api_pkg,
null                                 object_validation_api_proc,
null                                 object_defaulting_api_pkg,
null                                 object_defaulting_api_proc,
ari.region_validation_api_pkg        region_validation_api_pkg,
ari.region_validation_api_proc       region_validation_api_proc,
ari.region_defaulting_api_pkg        region_defaulting_api_pkg,
ari.region_defaulting_api_proc       region_defaulting_api_proc,
ari.lov_foreign_key_name             lov_foreign_key_name,
ari.lov_region_application_id        lov_region_application_id,
ari.lov_region_code                  lov_region_code,
ari.lov_attribute_application_id     lov_attribute_application_id,
ari.lov_attribute_code               lov_attribute_code,
ari.lov_default_flag                 lov_default_flag,
ari.order_sequence			order_sequence,
ari.order_direction			order_direction,
aa.data_type				data_type
FROM  ak_excluded_items aei,
ak_resp_security_attributes arsa,
ak_attributes aa,
ak_region_items_tl arit,
ak_region_items ari
WHERE ari.object_attribute_flag <> 'Y'
AND   ari.region_code = p_child_region_code
AND   ari.region_application_id = p_child_region_appl_id
AND   arit.region_code = ari.region_code
AND   arit.region_application_id = ari.region_application_id
AND   arit.attribute_code = ari.attribute_code
AND   arit.attribute_application_id = ari.attribute_application_id
AND   arit.language = userenv('LANG')
AND   aei.responsibility_id (+) = p_responsibility_id
AND   aei.attribute_application_id (+) = ari.attribute_application_id
AND   aei.attribute_code (+) = ari.attribute_code
AND   arsa.responsibility_id (+) = p_responsibility_id
AND   arsa.attribute_application_id (+) = ari.attribute_application_id
AND   arsa.attribute_code (+) = ari.attribute_code
AND   ari.attribute_code = aa.attribute_code
AND   ari.attribute_application_id = aa.attribute_application_id
ORDER BY 2;
Line: 879

select_rec select_cur%rowtype;
Line: 890

SELECT nvl(to_char(number_value),
nvl(varchar2_value,to_char(date_value))) sec_value
FROM ak_web_user_sec_attr_values awusav
WHERE awusav.web_user_id = p_user_id
AND awusav.attribute_application_id = p_attribute_appl_id
AND awusav.attribute_code = p_attribute_code
union
SELECT nvl(to_char(number_value),
nvl(varchar2_value,to_char(date_value))) sec_value
FROM  AK_RESP_SECURITY_ATTR_VALUES arsav
WHERE arsav.responsibility_id = p_responsibility_id
AND arsav.attribute_application_id = p_attribute_appl_id
AND arsav.attribute_code = p_attribute_code;
Line: 909

select_count			number := 0;
Line: 912

select_stmt			varchar2(10000);
Line: 945

OPEN select_cur(p_region_rec.region_application_id,
p_region_rec.region_code,
p_responsibility_id);
Line: 949

print_debug('building select list and order by list');
Line: 951

FETCH select_cur INTO select_rec;
Line: 952

EXIT WHEN select_cur%NOTFOUND;
Line: 953

row_count := select_cur%ROWCOUNT;
Line: 956

(p_return_node_display_only and select_rec.node_display_flag = 'Y') ) then
IF select_rec.object_attribute_flag = 'Y' THEN
select_count := select_count + 1;
Line: 960

IF (select_count > 1) THEN
select_stmt := select_stmt || ', ';
Line: 964

if ( select_rec.data_type = 'DATETIME' ) then
select value into l_date_format
from V$NLS_PARAMETERS WHERE PARAMETER='NLS_DATE_FORMAT';
Line: 968

select_stmt := select_stmt ||'TO_CHAR(akq.'||
select_rec.column_name||', '''||
l_date_format||''')';
Line: 972

select_stmt := select_stmt || 'SUBSTR(akq.'||
select_rec.column_name ||',1,4000)';
Line: 975

print_debug('select column = '||select_rec.column_name);
Line: 977

IF select_rec.order_sequence IS NOT NULL THEN
order_by_col_tab(select_rec.order_sequence) := select_rec.column_name;
Line: 979

order_by_dir_tab(select_rec.order_sequence) :=
select_rec.order_direction;
Line: 989

(p_return_node_display_only and select_rec.node_display_flag = 'Y') ) then

--
-- Add item defintion to g_items_table.
--
print_debug('Adding attribute to Items Table = '||
select_rec.attribute_code);
Line: 998

g_items_table(i).attribute_application_id     := select_rec.attribute_application_id;
Line: 999

g_items_table(i).attribute_code               := select_rec.attribute_code;
Line: 1000

g_items_table(i).attribute_label_long         := select_rec.attribute_label_long;
Line: 1001

g_items_table(i).attribute_label_length       := select_rec.attribute_label_length;
Line: 1002

g_items_table(i).attribute_value_length       := select_rec.attribute_value_length;
Line: 1003

g_items_table(i).display_value_length         := select_rec.display_value_length;
Line: 1004

g_items_table(i).display_sequence             := select_rec.display_sequence;
Line: 1005

g_items_table(i).item_style                   := select_rec.item_style;
Line: 1006

g_items_table(i).bold                         := select_rec.bold;
Line: 1007

g_items_table(i).italic                       := select_rec.italic;
Line: 1008

g_items_table(i).vertical_alignment           := select_rec.vertical_alignment;
Line: 1009

g_items_table(i).horizontal_alignment         := select_rec.horizontal_alignment;
Line: 1010

g_items_table(i).object_attribute_flag        := select_rec.object_attribute_flag;
Line: 1011

g_items_table(i).node_query_flag              := select_rec.node_query_flag;
Line: 1012

g_items_table(i).node_display_flag            := select_rec.node_display_flag;
Line: 1013

g_items_table(i).update_flag                  := select_rec.update_flag;
Line: 1014

g_items_table(i).required_flag                := select_rec.required_flag;
Line: 1015

g_items_table(i).icx_custom_call              := select_rec.icx_custom_call;
Line: 1016

g_items_table(i).region_defaulting_api_pkg    := select_rec.region_defaulting_api_pkg;
Line: 1017

g_items_table(i).region_defaulting_api_proc   := select_rec.region_defaulting_api_proc;
Line: 1018

g_items_table(i).region_validation_api_pkg    := select_rec.region_validation_api_pkg;
Line: 1019

g_items_table(i).region_validation_api_proc   := select_rec.region_validation_api_proc;
Line: 1020

g_items_table(i).object_defaulting_api_pkg    := select_rec.object_defaulting_api_pkg;
Line: 1021

g_items_table(i).object_defaulting_api_proc   := select_rec.object_defaulting_api_proc;
Line: 1022

g_items_table(i).object_validation_api_pkg    := select_rec.object_validation_api_pkg;
Line: 1023

g_items_table(i).object_validation_api_proc   := select_rec.object_validation_api_proc;
Line: 1024

g_items_table(i).lov_foreign_key_name         := select_rec.lov_foreign_key_name;
Line: 1025

g_items_table(i).lov_region_application_id    := select_rec.lov_region_application_id;
Line: 1026

g_items_table(i).lov_region_code              := select_rec.lov_region_code;
Line: 1027

g_items_table(i).lov_attribute_application_id := select_rec.lov_attribute_application_id;
Line: 1028

g_items_table(i).lov_attribute_code           := select_rec.lov_attribute_code;
Line: 1029

g_items_table(i).lov_default_flag             := select_rec.lov_default_flag;
Line: 1030

g_items_table(i).secured_column  		    := select_rec.secured_column;
Line: 1031

g_items_table(i).indexed_column  		    := select_rec.indexed_column;
Line: 1032

g_items_table(i).rls_column  		    := select_rec.rls_column;
Line: 1039

IF select_rec.object_attribute_flag = 'Y' THEN
g_items_table(i).value_id := results_table_value_id;
Line: 1056

IF select_rec.rls_column = 'T' THEN
-- if there are more than 255 sec attr values, force p_use_subquery
-- to TRUE
rec_count := 0;
Line: 1061

for attr_values_rec in attr_values_cur(p_user_id, select_rec.attribute_application_id,
select_rec.attribute_code, p_responsibility_id) loop
rec_count := rec_count + 1;
Line: 1077

select_rec.attribute_application_id,
select_rec.attribute_code,
p_responsibility_id) LOOP
i := i + 1;
Line: 1083

where_temp := '(akq.'||select_rec.column_name || ' IN (';
Line: 1088

to_char(select_count)||'_'||to_char(i);
Line: 1090

'BIND'||to_char(select_count)||'_'||to_char(i);
Line: 1102

to_char(select_count)||'_'||to_char(i);
Line: 1104

'BIND'||to_char(select_count)||'_'||to_char(i);
Line: 1111

where_temp := '(akq.' || select_rec.column_name || ' = NULL)';
Line: 1117

where_temp := '(akq.'||select_rec.column_name || ' IN ('
|| 'SELECT nvl(number_value,nvl(varchar2_value,date_value)) '
|| 'FROM ak_web_user_sec_attr_values awusav '
|| 'WHERE awusav.web_user_id = :BIND'
|| to_char(select_count) || 'USER_ID '
|| 'AND awusav.attribute_application_id = :BIND'
|| to_char(select_count) || 'ATTR_APPL_ID '
|| 'AND awusav.attribute_code = :BIND'
|| to_char(select_count) || 'ATTR_CODE '
|| 'union '
|| 'SELECT nvl(number_value,nvl(varchar2_value,date_value)) '
|| 'FROM AK_RESP_SECURITY_ATTR_VALUES arsav '
|| 'WHERE arsav.responsibility_id = :BIND'
|| to_char(select_count) || 'RESPONSIBILITY_ID '
|| 'AND arsav.attribute_application_id = :BIND'
|| to_char(select_count) || 'ATTR_APPL_ID '
|| 'AND arsav.attribute_code = :BIND'
|| to_char(select_count) || 'ATTR_CODE ))';
Line: 1140

p_rls_binds(i+1).name := 'BIND'||to_char(select_count)||'USER_ID';
Line: 1142

p_rls_binds(i+2).name := 'BIND'||to_char(select_count)||
'ATTR_APPL_ID';
Line: 1144

p_rls_binds(i+2).value := select_rec.attribute_application_id;
Line: 1145

p_rls_binds(i+3).name := 'BIND'||to_char(select_count)||
'ATTR_CODE';
Line: 1147

p_rls_binds(i+3).value := select_rec.attribute_code;
Line: 1148

p_rls_binds(i+4).name := 'BIND'||to_char(select_count)||'RESPONSIBILITY_ID';
Line: 1159

p_num_select := select_count;
Line: 1160

print_debug('Select count = '||to_char(select_count));
Line: 1161

CLOSE select_cur;
Line: 1172

IF select_stmt IS NOT NULL THEN
select_stmt := select_stmt ||', ';
Line: 1176

select_stmt := select_stmt || 'TO_CHAR(akq.'||l_uk_column_tab(i).name||
',''YYYY/MM/DD HH24:MI:SS'')';
Line: 1179

select_stmt := select_stmt || 'akq.' || l_uk_column_tab(i).name;
Line: 1204

j number := select_count + key_count;
Line: 1226

select_stmt := select_stmt ||', akq.'|| order_by_col_tab(i);
Line: 1235

order_by_stmt := order_by_stmt ||to_char(select_count + uk_column_index + 1)||' '||order_by_dir_tab(i);
Line: 1304

p_select := select_stmt;
Line: 1330

l_query_stmt := 'SELECT '||select_stmt||' FROM '||
p_region_rec.database_object_name ||' akq' ||
' WHERE '||where_stmt;
Line: 1371

p_num_select        	        IN number,
p_num_key       	        IN number,
p_region_rec			IN region_rec,
p_display_region		IN boolean,
p_key_values			OUT NOCOPY rel_key_value_tab
)
IS

key_index		number := 0;
Line: 1390

FOR display_index in 0..(p_num_select + p_num_key - 1) LOOP

IF (display_index < p_num_select) THEN
--
-- Retrieve display attribute values
--
dbms_sql.column_value(p_cursor_id, display_index + 1,
display_value(display_index));
Line: 1453

if (1 <= p_num_select) then
g_results_table(i).value1 := display_value(0);
Line: 1456

if (2 <= p_num_select) then
g_results_table(i).value2 := display_value(1);
Line: 1459

if (3 <= p_num_select) then
g_results_table(i).value3 := display_value(2);
Line: 1462

if (4 <= p_num_select) then
g_results_table(i).value4 := display_value(3);
Line: 1465

if (5 <= p_num_select) then
g_results_table(i).value5 := display_value(4);
Line: 1468

if (6 <= p_num_select) then
g_results_table(i).value6 := display_value(5);
Line: 1471

if (7 <= p_num_select) then
g_results_table(i).value7 := display_value(6);
Line: 1474

if (8 <= p_num_select) then
g_results_table(i).value8 := display_value(7);
Line: 1477

if (9 <= p_num_select) then
g_results_table(i).value9 := display_value(8);
Line: 1480

if (10 <= p_num_select) then
g_results_table(i).value10 := display_value(9);
Line: 1483

if (11 <= p_num_select) then
g_results_table(i).value11 := display_value(10);
Line: 1486

if (12 <= p_num_select) then
g_results_table(i).value12 := display_value(11);
Line: 1489

if (13 <= p_num_select) then
g_results_table(i).value13 := display_value(12);
Line: 1492

if (14 <= p_num_select) then
g_results_table(i).value14 := display_value(13);
Line: 1495

if (15 <= p_num_select) then
g_results_table(i).value15 := display_value(14);
Line: 1498

if (16 <= p_num_select) then
g_results_table(i).value16 := display_value(15);
Line: 1501

if (17 <= p_num_select) then
g_results_table(i).value17 := display_value(16);
Line: 1504

if (18 <= p_num_select) then
g_results_table(i).value18 := display_value(17);
Line: 1507

if (19 <= p_num_select) then
g_results_table(i).value19 := display_value(18);
Line: 1510

if (20 <= p_num_select) then
g_results_table(i).value20 := display_value(19);
Line: 1513

if (21 <= p_num_select) then
g_results_table(i).value21 := display_value(20);
Line: 1516

if (22 <= p_num_select) then
g_results_table(i).value22 := display_value(21);
Line: 1519

if (23 <= p_num_select) then
g_results_table(i).value23 := display_value(22);
Line: 1522

if (24 <= p_num_select) then
g_results_table(i).value24 := display_value(23);
Line: 1525

if (25 <= p_num_select) then
g_results_table(i).value25 := display_value(24);
Line: 1528

if (26 <= p_num_select) then
g_results_table(i).value26 := display_value(25);
Line: 1531

if (27 <= p_num_select) then
g_results_table(i).value27 := display_value(26);
Line: 1534

if (28 <= p_num_select) then
g_results_table(i).value28 := display_value(27);
Line: 1537

if (29 <= p_num_select) then
g_results_table(i).value29 := display_value(28);
Line: 1540

if (30 <= p_num_select) then
g_results_table(i).value30 := display_value(29);
Line: 1543

if (31 <= p_num_select) then
g_results_table(i).value31 := display_value(30);
Line: 1546

if (32 <= p_num_select) then
g_results_table(i).value32 := display_value(31);
Line: 1549

if (33 <= p_num_select) then
g_results_table(i).value33 := display_value(32);
Line: 1552

if (34 <= p_num_select) then
g_results_table(i).value34 := display_value(33);
Line: 1555

if (35 <= p_num_select) then
g_results_table(i).value35 := display_value(34);
Line: 1558

if (36 <= p_num_select) then
g_results_table(i).value36 := display_value(35);
Line: 1561

if (37 <= p_num_select) then
g_results_table(i).value37 := display_value(36);
Line: 1564

if (38 <= p_num_select) then
g_results_table(i).value38 := display_value(37);
Line: 1567

if (39 <= p_num_select) then
g_results_table(i).value39 := display_value(38);
Line: 1570

if (40 <= p_num_select) then
g_results_table(i).value40 := display_value(39);
Line: 1573

if (41 <= p_num_select) then
g_results_table(i).value41 := display_value(40);
Line: 1576

if (42 <= p_num_select) then
g_results_table(i).value42 := display_value(41);
Line: 1579

if (43 <= p_num_select) then
g_results_table(i).value43 := display_value(42);
Line: 1582

if (44 <= p_num_select) then
g_results_table(i).value44 := display_value(43);
Line: 1585

if (45 <= p_num_select) then
g_results_table(i).value45 := display_value(44);
Line: 1588

if (46 <= p_num_select) then
g_results_table(i).value46 := display_value(45);
Line: 1591

if (47 <= p_num_select) then
g_results_table(i).value47 := display_value(46);
Line: 1594

if (48 <= p_num_select) then
g_results_table(i).value48 := display_value(47);
Line: 1597

if (49 <= p_num_select) then
g_results_table(i).value49 := display_value(48);
Line: 1600

if (50 <= p_num_select) then
g_results_table(i).value50 := display_value(49);
Line: 1603

if (51 <= p_num_select) then
g_results_table(i).value51 := display_value(50);
Line: 1606

if (52 <= p_num_select) then
g_results_table(i).value52 := display_value(51);
Line: 1609

if (53 <= p_num_select) then
g_results_table(i).value53 := display_value(52);
Line: 1612

if (54 <= p_num_select) then
g_results_table(i).value54 := display_value(53);
Line: 1615

if (55 <= p_num_select) then
g_results_table(i).value55 := display_value(54);
Line: 1618

if (56 <= p_num_select) then
g_results_table(i).value56 := display_value(55);
Line: 1621

if (57 <= p_num_select) then
g_results_table(i).value57 := display_value(56);
Line: 1624

if (58 <= p_num_select) then
g_results_table(i).value58 := display_value(57);
Line: 1627

if (59 <= p_num_select) then
g_results_table(i).value59 := display_value(58);
Line: 1630

if (60 <= p_num_select) then
g_results_table(i).value60 := display_value(59);
Line: 1633

if (61 <= p_num_select) then
g_results_table(i).value61 := display_value(60);
Line: 1636

if (62 <= p_num_select) then
g_results_table(i).value62 := display_value(61);
Line: 1639

if (63 <= p_num_select) then
g_results_table(i).value63 := display_value(62);
Line: 1642

if (64 <= p_num_select) then
g_results_table(i).value64 := display_value(63);
Line: 1645

if (65 <= p_num_select) then
g_results_table(i).value65 := display_value(64);
Line: 1648

if (66 <= p_num_select) then
g_results_table(i).value66 := display_value(65);
Line: 1651

if (67 <= p_num_select) then
g_results_table(i).value67 := display_value(66);
Line: 1654

if (68 <= p_num_select) then
g_results_table(i).value68 := display_value(67);
Line: 1657

if (69 <= p_num_select) then
g_results_table(i).value69 := display_value(68);
Line: 1660

if (70 <= p_num_select) then
g_results_table(i).value70 := display_value(69);
Line: 1663

if (71 <= p_num_select) then
g_results_table(i).value71 := display_value(70);
Line: 1666

if (72 <= p_num_select) then
g_results_table(i).value72 := display_value(71);
Line: 1669

if (73 <= p_num_select) then
g_results_table(i).value73 := display_value(72);
Line: 1672

if (74 <= p_num_select) then
g_results_table(i).value74 := display_value(73);
Line: 1675

if (75 <= p_num_select) then
g_results_table(i).value75 := display_value(74);
Line: 1678

if (76 <= p_num_select) then
g_results_table(i).value76 := display_value(75);
Line: 1681

if (77 <= p_num_select) then
g_results_table(i).value77 := display_value(76);
Line: 1684

if (78 <= p_num_select) then
g_results_table(i).value78 := display_value(77);
Line: 1687

if (79 <= p_num_select) then
g_results_table(i).value79 := display_value(78);
Line: 1690

if (80 <= p_num_select) then
g_results_table(i).value80 := display_value(79);
Line: 1693

if (81 <= p_num_select) then
g_results_table(i).value81 := display_value(80);
Line: 1696

if (82 <= p_num_select) then
g_results_table(i).value82 := display_value(81);
Line: 1699

if (83 <= p_num_select) then
g_results_table(i).value83 := display_value(82);
Line: 1702

if (84 <= p_num_select) then
g_results_table(i).value84 := display_value(83);
Line: 1705

if (85 <= p_num_select) then
g_results_table(i).value85 := display_value(84);
Line: 1708

if (86 <= p_num_select) then
g_results_table(i).value86 := display_value(85);
Line: 1711

if (87 <= p_num_select) then
g_results_table(i).value87 := display_value(86);
Line: 1714

if (88 <= p_num_select) then
g_results_table(i).value88 := display_value(87);
Line: 1717

if (89 <= p_num_select) then
g_results_table(i).value89 := display_value(88);
Line: 1720

if (90 <= p_num_select) then
g_results_table(i).value90 := display_value(89);
Line: 1723

if (91 <= p_num_select) then
g_results_table(i).value91 := display_value(90);
Line: 1726

if (92 <= p_num_select) then
g_results_table(i).value92 := display_value(91);
Line: 1729

if (93 <= p_num_select) then
g_results_table(i).value93 := display_value(92);
Line: 1732

if (94 <= p_num_select) then
g_results_table(i).value94 := display_value(93);
Line: 1735

if (95 <= p_num_select) then
g_results_table(i).value95 := display_value(94);
Line: 1738

if (96 <= p_num_select) then
g_results_table(i).value96 := display_value(95);
Line: 1741

if (97 <= p_num_select) then
g_results_table(i).value97 := display_value(96);
Line: 1744

if (98 <= p_num_select) then
g_results_table(i).value98 := display_value(97);
Line: 1747

if (99 <= p_num_select) then
g_results_table(i).value99 := display_value(98);
Line: 1750

if (100 <= p_num_select) then
g_results_table(i).value100:= display_value(99);
Line: 1769

p_num_select                  IN number
)
IS

select_index    number := 0;
Line: 1781

FOR select_index in 0..(p_num_select - 1) LOOP
dbms_sql.define_column(p_cursor_id, select_index + 1, NULL, 4000);
Line: 1872

p_select			IN varchar2,
p_from			IN varchar2,
p_where			IN varchar2,
p_order_by			IN varchar2
)
IS
l_region_style              	varchar2(30);
Line: 1898

SELECT fpr.region_style              region_style,
fpr.num_columns               number_of_format_columns,
art.name                      region_name,
ao.validation_api_pkg         object_validation_api_pkg,
ao.validation_api_proc        object_validation_api_proc,
ao.defaulting_api_pkg         object_defaulting_api_pkg,
ao.defaulting_api_proc        object_defaulting_api_proc,
ar.region_validation_api_pkg  region_validation_api_pkg,
ar.region_validation_api_proc region_validation_api_proc,
ar.region_defaulting_api_pkg  region_defaulting_api_pkg,
ar.region_defaulting_api_proc region_defaulting_api_proc,
fpr.display_sequence		 display_sequence
INTO   l_region_style              ,
l_number_of_format_columns  ,
l_region_name               ,
l_object_validation_api_pkg ,
l_object_validation_api_proc,
l_object_defaulting_api_pkg ,
l_object_defaulting_api_proc,
l_region_validation_api_pkg ,
l_region_validation_api_proc,
l_region_defaulting_api_pkg ,
l_region_defaulting_api_proc,
l_display_sequence
FROM ak_flow_page_regions fpr,
ak_regions ar,
ak_regions_tl art,
ak_objects ao
WHERE fpr.flow_application_id = p_region_rec.flow_application_id
AND fpr.flow_code = p_region_rec.flow_code
AND fpr.page_application_id = p_region_rec.page_application_id
AND fpr.page_code = p_region_rec.page_code
AND fpr.region_application_id = p_region_rec.region_application_id
AND fpr.region_code = p_region_rec.region_code
AND ar.region_application_id = fpr.region_application_id
AND ar.region_code = fpr.region_code
AND art.region_application_id = ar.region_application_id
AND art.region_code = ar.region_code
AND art.language = userenv('LANG')
AND ao.database_object_name = ar.database_object_name;
Line: 1944

SELECT ar.region_style               region_style,
ar.num_columns                number_of_format_columns,
art.name                      region_name,
ao.validation_api_pkg         object_validation_api_pkg,
ao.validation_api_proc        object_validation_api_proc,
ao.defaulting_api_pkg         object_defaulting_api_pkg,
ao.defaulting_api_proc        object_defaulting_api_proc,
ar.region_validation_api_pkg  region_validation_api_pkg,
ar.region_validation_api_proc region_validation_api_proc,
ar.region_defaulting_api_pkg  region_defaulting_api_pkg,
ar.region_defaulting_api_proc region_defaulting_api_proc,
null
INTO   l_region_style              ,
l_number_of_format_columns  ,
l_region_name               ,
l_object_validation_api_pkg ,
l_object_validation_api_proc,
l_object_defaulting_api_pkg ,
l_object_defaulting_api_proc,
l_region_validation_api_pkg ,
l_region_validation_api_proc,
l_region_defaulting_api_pkg ,
l_region_defaulting_api_proc,
l_display_sequence
FROM ak_regions ar,
ak_regions_tl art,
ak_objects ao
WHERE ar.region_application_id = p_region_rec.region_application_id
AND ar.region_code = p_region_rec.region_code
AND art.region_application_id = ar.region_application_id
AND art.region_code = ar.region_code
AND art.language = userenv('LANG')
AND ao.database_object_name = ar.database_object_name;
Line: 2005

g_regions_table(i).sql_select			:= p_select;
Line: 2085

l_sql_statement varchar2(2000) := 'SELECT ';
Line: 2188

SELECT aoa.column_name foreign_key_column_name, aa.data_type
FROM ak_foreign_keys afk,
ak_foreign_key_columns afkc,
ak_object_attributes aoa,
ak_attributes aa
WHERE
afk.database_object_name = aoa.database_object_name
AND  afkc.attribute_application_id = aoa.attribute_application_id
AND  afkc.attribute_code = aoa.attribute_code
AND  afkc.foreign_key_name = afk.foreign_key_name
AND  afk.foreign_key_name = foreign_key_name_param
AND  aoa.attribute_code = aa.attribute_code
AND  aoa.attribute_application_id = aa.attribute_application_id
ORDER BY afkc.foreign_key_sequence;
Line: 2238

SELECT aoa.column_name unique_key_column_name, aa.data_type
FROM ak_unique_keys auk,
ak_unique_key_columns aukc,
ak_object_attributes aoa,
ak_attributes aa
WHERE
auk.database_object_name = aoa.database_object_name
AND  aukc.attribute_application_id = aoa.attribute_application_id
AND  aukc.attribute_code = aoa.attribute_code
AND  aukc.unique_key_name = auk.unique_key_name
AND  auk.unique_key_name = unique_key_name_param
AND  aoa.attribute_code = aa.attribute_code
AND  aoa.attribute_application_id = aa.attribute_application_id
ORDER BY aukc.unique_key_sequence;
Line: 2479

CURSOR select_cur
(
p_child_region_appl_id              NUMBER,
p_child_region_code                 VARCHAR2,
p_responsibility_id                 NUMBER,
p_node_display_criteria             VARCHAR2
)
IS
-- Select region_items that are also object_attributes
SELECT aoa.column_name                      column_name,
ari.display_sequence                 display_sequence,
ari.attribute_application_id         attribute_application_id,
ari.attribute_code                   attribute_code,
decode(aei.attribute_code,NULL,'F','T')  secured_column,
decode(arsa.attribute_code,NULL,'F','T') rls_column,
decode(ari.icx_custom_call,'INDEX','T','F') indexed_column,
arit.attribute_label_long            attribute_label_long,
ari.attribute_label_length           attribute_label_length,
aa.attribute_value_length		attribute_value_length,
ari.display_value_length             display_value_length,
ari.item_style                       item_style,
ari.bold                             bold,
ari.italic                           italic,
ari.vertical_alignment               vertical_alignment,
ari.horizontal_alignment             horizontal_alignment,
ari.object_attribute_flag            object_attribute_flag,
ari.node_query_flag                  node_query_flag,
ari.node_display_flag                node_display_flag,
ari.update_flag                      update_flag,
ari.required_flag                    required_flag,
ari.icx_custom_call                  icx_custom_call,
aoa.validation_api_pkg               object_validation_api_pkg,
aoa.validation_api_proc              object_validation_api_proc,
aoa.defaulting_api_pkg               object_defaulting_api_pkg,
aoa.defaulting_api_proc              object_defaulting_api_proc,
ari.region_validation_api_pkg        region_validation_api_pkg,
ari.region_validation_api_proc       region_validation_api_proc,
ari.region_defaulting_api_pkg        region_defaulting_api_pkg,
ari.region_defaulting_api_proc       region_defaulting_api_proc,
ari.lov_foreign_key_name             lov_foreign_key_name,
ari.lov_region_application_id        lov_region_application_id,
ari.lov_region_code                  lov_region_code,
ari.lov_attribute_application_id     lov_attribute_application_id,
ari.lov_attribute_code               lov_attribute_code,
ari.lov_default_flag                 lov_default_flag,
ari.order_sequence			order_sequence,
ari.order_direction			order_direction,
aa.data_type				data_type
FROM  ak_object_attributes aoa,
ak_excluded_items aei,
ak_resp_security_attributes arsa,
ak_attributes aa,
ak_regions ar,
ak_region_items_tl arit,
ak_region_items ari
WHERE ari.object_attribute_flag = 'Y'
AND  aoa.attribute_application_id = ari.attribute_application_id
AND  aoa.attribute_code = ari.attribute_code
AND  aoa.database_object_name = ar.database_object_name
AND  ar.region_application_id = ari.region_application_id
AND  ar.region_code = ari.region_code
AND  ari.region_code = p_child_region_code
AND  ari.region_application_id = p_child_region_appl_id
AND  ari.node_display_flag =
decode(p_node_display_criteria,'Y','Y',ari.node_display_flag)
AND  arit.region_code = ari.region_code
AND  arit.region_application_id = ari.region_application_id
AND  arit.attribute_code = ari.attribute_code
AND  arit.attribute_application_id = ari.attribute_application_id
AND  arit.language = userenv('LANG')
AND  aei.responsibility_id (+) = p_responsibility_id
AND  aei.attribute_application_id (+) = ari.attribute_application_id
AND  aei.attribute_code (+) = ari.attribute_code
AND  arsa.responsibility_id (+) = p_responsibility_id
AND  arsa.attribute_application_id (+) = ari.attribute_application_id
AND  arsa.attribute_code (+) = ari.attribute_code
AND  ari.attribute_code = aa.attribute_code
AND  ari.attribute_application_id = aa.attribute_application_id
UNION ALL
-- Select region_items that are not object attributes
SELECT null                                 column_name,
ari.display_sequence                 display_sequence,
ari.attribute_application_id         attribute_application_id,
ari.attribute_code                   attribute_code,
decode(aei.attribute_code,NULL,'F','T')  secured_column,
decode(arsa.attribute_code,NULL,'F','T') rls_column,
decode(ari.icx_custom_call,'INDEX','T','F') indexed_column,
arit.attribute_label_long            attribute_label_long,
ari.attribute_label_length           attribute_label_length,
aa.attribute_value_length		attribute_value_length,
ari.display_value_length             display_value_length,
ari.item_style                       item_style,
ari.bold                             bold,
ari.italic                           italic,
ari.vertical_alignment               vertical_alignment,
ari.horizontal_alignment             horizontal_alignment,
ari.object_attribute_flag            object_attribute_flag,
ari.node_query_flag                  node_query_flag,
ari.node_display_flag                node_display_flag,
ari.update_flag                      update_flag,
ari.required_flag                    required_flag,
ari.icx_custom_call                  icx_custom_call,
null                                 object_validation_api_pkg,
null                                 object_validation_api_proc,
null                                 object_defaulting_api_pkg,
null                                 object_defaulting_api_proc,
ari.region_validation_api_pkg        region_validation_api_pkg,
ari.region_validation_api_proc       region_validation_api_proc,
ari.region_defaulting_api_pkg        region_defaulting_api_pkg,
ari.region_defaulting_api_proc       region_defaulting_api_proc,
ari.lov_foreign_key_name             lov_foreign_key_name,
ari.lov_region_application_id        lov_region_application_id,
ari.lov_region_code                  lov_region_code,
ari.lov_attribute_application_id     lov_attribute_application_id,
ari.lov_attribute_code               lov_attribute_code,
ari.lov_default_flag                 lov_default_flag,
ari.order_sequence			order_sequence,
ari.order_direction			order_direction,
aa.data_type				data_type
FROM  ak_excluded_items aei,
ak_resp_security_attributes arsa,
ak_attributes aa,
ak_region_items_tl arit,
ak_region_items ari
WHERE ari.object_attribute_flag <> 'Y'
AND   ari.region_code = p_child_region_code
AND   ari.region_application_id = p_child_region_appl_id
AND   ari.node_display_flag =
decode(p_node_display_criteria,'Y','Y',ari.node_display_flag)
AND   arit.region_code = ari.region_code
AND   arit.region_application_id = ari.region_application_id
AND   arit.attribute_code = ari.attribute_code
AND   arit.attribute_application_id = ari.attribute_application_id
AND   arit.language = userenv('LANG')
AND   aei.responsibility_id (+) = p_responsibility_id
AND   aei.attribute_application_id (+) = ari.attribute_application_id
AND   aei.attribute_code (+) = ari.attribute_code
AND   arsa.responsibility_id (+) = p_responsibility_id
AND   arsa.attribute_application_id (+) = ari.attribute_application_id
AND   arsa.attribute_code (+) = ari.attribute_code
AND   ari.attribute_code = aa.attribute_code
AND   ari.attribute_application_id = aa.attribute_application_id
ORDER BY 2;
Line: 2624

select_rec select_cur%rowtype;
Line: 2635

SELECT nvl(to_char(number_value),nvl(varchar2_value, to_char(date_value))) sec_value
FROM ak_web_user_sec_attr_values awusav
WHERE awusav.web_user_id = p_user_id
AND awusav.attribute_application_id = p_attribute_appl_id
AND awusav.attribute_code = p_attribute_code
union
SELECT nvl(to_char(number_value),
nvl(varchar2_value,to_char(date_value))) sec_value
FROM AK_RESP_SECURITY_ATTR_VALUES arsav
WHERE arsav.responsibility_id = p_responsibility_id
AND arsav.attribute_application_id = p_attribute_appl_id
AND arsav.attribute_code = p_attribute_code;
Line: 2651

select_count1                 number := 0;
Line: 2652

select_count2                 number := 0;
Line: 2653

select_count                  number := 0;
Line: 2655

select_stmt                   varchar2(20000);
Line: 2669

l_query_stmt := 'SELECT ';
Line: 2687

OPEN select_cur(p_region_rec.region_application_id,
p_region_rec.region_code,
p_responsibility_id,
node_display_criteria);
Line: 2693

FETCH select_cur INTO select_rec;
Line: 2694

EXIT WHEN select_cur%NOTFOUND;
Line: 2695

row_count := select_cur%ROWCOUNT;
Line: 2697

print_debug('select column1 = '||select_rec.column_name);
Line: 2698

print_debug('secure value1 = '||select_rec.rls_column);
Line: 2699

print_debug('obj attr flag = '||select_rec.object_attribute_flag);
Line: 2703

print_debug ( 'Secured Value is -> ' || select_rec.rls_column);
Line: 2713

IF select_rec.rls_column = 'T'  THEN
where_temp := NULL;
Line: 2719

SELECT count(*)
INTO   select_count1
FROM ak_web_user_sec_attr_values awusav
WHERE awusav.web_user_id = p_user_id
AND awusav.attribute_application_id = select_rec.attribute_application_id
AND awusav.attribute_code = select_rec.attribute_code
AND (( varchar2_value is not null and date_value is not null) or
( varchar2_value is not null and number_value is not null) or
( date_value is not null and number_value is not null));
Line: 2729

SELECT count(*)
INTO   select_count2
FROM ak_resp_security_attr_values arsav
WHERE arsav.responsibility_id = p_responsibility_id
AND arsav.attribute_application_id = select_rec.attribute_application_id
AND arsav.attribute_code = select_rec.attribute_code
AND (( varchar2_value is not null and date_value is not null) or
( varchar2_value is not null and number_value is not null) or
( date_value is not null and number_value is not null));
Line: 2739

select_count := select_count1 + select_count2;
Line: 2740

if select_count = 0 then
FOR attr_values_rec IN attr_values_cur(p_user_id,
select_rec.attribute_application_id,
select_rec.attribute_code,
p_responsibility_id) LOOP
IF where_temp IS NULL THEN
where_temp := '('||select_rec.column_name || ' IN (';
Line: 2762

where_temp := '(' || select_rec.column_name || ' = NULL)';
Line: 2768

CLOSE select_cur;