Skip to content

Instantly share code, notes, and snippets.

View vincentdeelen's full-sized avatar

Vincent vincentdeelen

View GitHub Profile
@vincentdeelen
vincentdeelen / set column names
Last active August 29, 2015 13:56
Procedure to set hidden items with column header names
procedure set_column_headers
(p_table_name varchar2)
is
cursor c_columns
is
select column_name
from user_tab_columns
where table_name = upper(p_table_name)
order by column_id;
@vincentdeelen
vincentdeelen / create collection
Created February 8, 2014 18:04
Process to create collection based on a dynamic sql query
begin
if apex_collection.collection_exists
( p_collection_name => 'MY_COLLECTION' )
then
apex_collection.delete_collection
( p_collection_name => 'MY_COLLECTION' );
end if;
apex_collection.create_collection_from_query
( p_collection_name => 'MY_COLLECTION'
@vincentdeelen
vincentdeelen / ir query
Created February 8, 2014 18:10
Query for interactive report on collection
SELECT *
FROM APEX_collections
WHERE collection_name = 'MY_COLLECTION'
@vincentdeelen
vincentdeelen / display condition
Created February 8, 2014 18:19
Display condition for report column
select 1
from apex_collections
where collection_name = 'MY_COLLECTION'
and c0XX is not null
@vincentdeelen
vincentdeelen / csvExample
Last active August 29, 2015 13:57
Example csv file
EMPNO, ENAME, DEPTNO, DNAME
7369, SMITH, 20, RESEARCH
7499, ALLEN, 30, SALES
@vincentdeelen
vincentdeelen / empDeptVw
Created March 11, 2014 17:13
view and emp and dept
create or replace view emp_dept_v
as
select e.empno as empno
, e.ename as ename
, e.deptno as deptno
, d.dname as dname
from emp e
, dept d
where e.deptno = d.deptno
;
@vincentdeelen
vincentdeelen / insteadOfTrigger
Last active August 29, 2015 13:57
Instead of trigger on emp_dept_v
create or replace
trigger emp_dept_briu
instead of insert or update on emp_dept_v
referencing new as n
old as o
for each row
declare
l_deptno emp.deptno%type;
begin
case
@vincentdeelen
vincentdeelen / EmpNullRow
Last active August 29, 2015 13:57
padding an empty row to a table
select null
, null
, null
, null
from emp
union
select empno
, ename
, job
, deptno
@vincentdeelen
vincentdeelen / orderEmpNulls
Created April 16, 2014 10:07
Order the two tables using nulls first
select empno
, ename
, job
, deptno
from(
select null as empno
, null as ename
, null as job
, null as deptno
from emp
@vincentdeelen
vincentdeelen / addClasstoRows
Created April 16, 2014 10:15
add classes to each table row, except for the empty rows
$('#report_dept10 .uReportStandard tBody tr:not(:first)').each(
function(){
$(this).addClass( "emp ui-widget-content" );
var idVal = $(this).find('td[headers="EMPNO"]').html();
$(this).first('td').attr("id",idVal);
}
)
$('#report_dept20 .uReportStandard tBody tr:not(:first)').each(
function(){
$(this).addClass( "emp ui-widget-content" );