The following lines contain the word 'select', 'insert', 'update' or 'delete':
dynSQL := 'SELECT ';
dataSet.delete;
temp_columnDefs.DELETE;
select gridName
,grd.title_text
,grc.cols -- ColCount
,0 -- Current Row Count
,'T' -- more Rows exists
,null -- SQL statement
,null -- SQL cursor
,grd.grid_datasource_name
,grd.db_view_name
,grd.default_row_height
,grd.max_queried_rows
,grd.where_clause
,gsc.grid_sort_col_alias1
,gsc.grid_sort_col_alias2
,gsc.grid_sort_col_alias3
,'209,219,245' -- Ignore the col value, std color will be used nvl(grd.alt_color_code,'255,255,255')
,1 -- nvl(grd.alt_color_interval,0)
,null
,null
,null
,null
,'T' -- whereClauseChanged
,'T' -- bindVarsChanged
,'T' -- refreshFlag
,fetch_Size -- fetchSize
from jtf_grid_datasources_vl grd
,jtf_grid_sort_cols gsc
,(
select grid_datasource_name
,count(*) cols
from jtf_grid_cols_b
group by grid_datasource_name
) grc
where grd.grid_datasource_name = dataSource
and grd.grid_datasource_name = gsc.grid_datasource_name(+)
and grd.grid_datasource_name = grc.grid_datasource_name;
select cgs.custom_grid_id
,cgs.custom_grid_name
,cgs.default_row_height
,cgs.where_clause
,cgs.grid_sort_col_alias1
,cgs.grid_sort_col_alias2
,cgs.grid_sort_col_alias3
,cgs.public_flag
,cgs.created_by -- this is the owner
from jtf_custom_grids cgs
,jtf_def_custom_grids dcg
where dcg.grid_datasource_name = dataSource
and dcg.created_by = fnd_global.user_id
and dcg.custom_grid_id = cgs.custom_grid_id
and cgs.language = userenv('LANG');
select gridName
,grc.grid_datasource_name
,grc.grid_col_alias
,grc.db_col_name
,grc.data_type_code
,grc.query_seq
,grc.sortable_flag
,grc.sort_asc_by_default_flag
,grc.visible_flag
,grc.freeze_visible_flag
,null -- this needs to be converted to display_index
,grc.display_type_code
,grc.display_format_type_code
,grc.display_hsize
,grc.header_alignment_code
,grc.cell_alignment_code
,grc.display_format_mask
,grc.checkbox_checked_value
,grc.checkbox_unchecked_value
,nvl(grc.checkbox_other_values,'F')
,grc.db_currency_code_col
,null -- currency_column_alias
,grc.label_text
,grc.db_sort_column
,grc.fire_post_query_flag
,grc.image_description_col
,null -- SQL column alias
from jtf_grid_cols_vl grc
where grc.grid_datasource_name = dataSource
order by grc.query_seq;
select gridName
,grc.grid_datasource_name
,grc.grid_col_alias
,grc.db_col_name
,grc.data_type_code
,grc.query_seq
,grc.sortable_flag
,decode(grc.sortable_flag,'F',grc.sort_asc_by_default_flag,nvl(cgc.sort_asc_by_default_flag,grc.sort_asc_by_default_flag)) -- if false override customized value
,decode(grc.freeze_visible_flag,'T',grc.visible_flag,nvl(cgc.visible_flag,grc.visible_flag)) -- If true, override customized value
,grc.freeze_visible_flag
,null -- this needs to be converted to display_index
,grc.display_type_code
,grc.display_format_type_code
,nvl(cgc.display_hsize,grc.display_hsize)
,grc.header_alignment_code
,grc.cell_alignment_code
,grc.display_format_mask
,grc.checkbox_checked_value
,grc.checkbox_unchecked_value
,nvl(grc.checkbox_other_values,'F')
,grc.db_currency_code_col
,null -- currency_column_alias
,nvl(cgc.label_text,grc.label_text)
,grc.db_sort_column
,grc.fire_post_query_flag
,grc.image_description_col
,null -- sql column alias
from jtf_grid_cols_vl grc
,jtf_custom_grid_cols cgc
where grc.grid_datasource_name = dataSource
and grc.grid_datasource_name = cgc.grid_datasource_name(+)
and grc.grid_col_alias = cgc.grid_col_alias(+)
and cgc.custom_grid_id(+) = x_custom_grid_id
order by grc.query_seq;
select grc.grid_col_alias
from jtf_grid_cols_b grc
where grc.grid_datasource_name = datasource
order by grc.display_seq;
select grc.grid_col_alias
from jtf_grid_cols_vl grc
,jtf_custom_grid_cols cgc
where grc.grid_datasource_name = datasource
and grc.grid_datasource_name = cgc.grid_datasource_name(+)
and grc.grid_col_alias = cgc.grid_col_alias(+)
and cgc.custom_grid_id(+) = x_custom_grid_id
order by cgc.display_seq;
select grc.grid_col_alias
from jtf_grid_cols_b grc
where grc.grid_datasource_name = x_dataSource
and grc.db_col_name = x_db_currency_code_col;
select gsc.grid_sort_col_alias1
,gsc.grid_sort_col_alias2
,gsc.grid_sort_col_alias3
from jtf_grid_sort_cols gsc
where gsc.grid_datasource_name = dataSource;
update jtf_custom_grids
set grid_sort_col_alias1 = l_grid_sort_col_alias1
,grid_sort_col_alias2 = l_grid_sort_col_alias2
,grid_sort_col_alias3 = l_grid_sort_col_alias3
where custom_grid_id = tableDefs(tableIndex).custom_grid_id;
select label_text
from jtf_custom_grid_cols
where custom_grid_id = x_custom_grid_id
and grid_datasource_name = x_grid_datasource_name
and grid_col_alias = x_grid_col_alias;
select jtf_custom_grids_s.nextval
into l_custom_grid_id
from dual;
insert into jtf_custom_grids
(custom_grid_id
,grid_datasource_name
,custom_grid_name
,language
,grid_sort_col_alias1
,grid_sort_col_alias2
,grid_sort_col_alias3
,public_flag
,created_by
,creation_date
,last_updated_by
,last_update_date
,last_update_login
,where_clause
)
values
(l_custom_grid_id
,datasource
,l_custom_grid_name
,userenv('LANG')
,l_grid_sort_col_alias1
,l_grid_sort_col_alias2
,l_grid_sort_col_alias3
,l_public_flag
,fnd_global.user_id
,sysdate
,fnd_global.user_id
,sysdate
,fnd_global.login_id
,l_where_clause
);
insert into jtf_def_custom_grids
(grid_datasource_name
,created_by
,creation_date
,last_updated_by
,last_update_date
,last_update_login
,custom_grid_id
,language
)
values
(datasource
,fnd_global.user_id
,sysdate
,fnd_global.user_id
,sysdate
,fnd_global.login_id
,l_custom_grid_id
,userenv('LANG')
);
update jtf_custom_grids
set custom_grid_name = l_custom_grid_name
,grid_sort_col_alias1 = l_grid_sort_col_alias1
,grid_sort_col_alias2 = l_grid_sort_col_alias2
,grid_sort_col_alias3 = l_grid_sort_col_alias3
,public_flag = l_public_flag
,last_updated_by = fnd_global.user_id
,last_update_date = sysdate
,last_update_login = fnd_global.login_id
,where_clause = l_where_clause
where custom_grid_id = l_custom_grid_id;
insert into jtf_custom_grid_cols
(custom_grid_id
,grid_datasource_name
,grid_col_alias
,sort_asc_by_default_flag
,visible_flag
,display_seq
,display_hsize
,created_by
,creation_date
,last_updated_by
,last_update_date
,last_update_login
,label_text
)
values
(l_custom_grid_id
,datasource
,l_grid_col_alias
,l_sort_asc_by_default
,l_visible_flag
,l_display_seq
,l_display_hsize
,fnd_global.user_id
,sysdate
,fnd_global.user_id
,sysdate
,fnd_global.login_id
,l_label_text
);
update jtf_custom_grid_cols
set sort_asc_by_default_flag = l_sort_asc_by_default
,visible_flag = l_visible_flag
,display_seq = l_display_seq
,display_hsize = l_display_hsize
,last_updated_by = fnd_global.user_id
,last_update_date = sysdate
,last_update_login = fnd_global.login_id
,label_text = l_label_text
where custom_grid_id = l_custom_grid_id
and grid_datasource_name = dataSource
and grid_col_alias = l_grid_col_alias;
function deleteCustomizations(gridName in varchar2
,customGridId in number
,p_serverInitDate in date) return boolean is
PRAGMA AUTONOMOUS_TRANSACTION;
-- If customGridId is null we delete the current set.
l_custom_grid_id := nvl(customGridId,tableDefs(i).custom_grid_id);
delete from jtf_def_custom_grids
where custom_grid_id = l_custom_grid_id;
delete from jtf_custom_grid_cols
where custom_grid_id = l_custom_grid_id;
delete from jtf_custom_grids
where custom_grid_id = l_custom_grid_id;
handleErrors(INVALID_GRID_ERROR,'deleteCustomizations',gridName,null,null);
end deleteCustomizations;
procedure deleteColDef(gridName in varchar2) is
i binary_integer;
columnDefs.delete(i);
handleErrors(INTERNAL_ERROR,'deleteColDef',gridName,null,SQLERRM);
end deleteColDef;
tableDefs.delete(tableIndex);
deleteColDef(gridName);
bindVariables.DELETE(i);