Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Giffy D'Souza martindsouza

View GitHub Profile
View test.sql
-- prompt hello from github
select sysdate
from dual
;
View test.sql
-- Test
-- Another test
alias testmartin=select 1
from dual
/
alias fk=select f.constraint_name, f.r_owner || '.' || f.r_constraint_name reference_constraint
, t.table_name
View steven-dml-error-feedback.sql
-- Feedback based on https://www.insum.ca/feuertip-7-how-not-to-handle-dml-errors/
create or replace procedure full_of_dml (
p_order in number,
p_lines in lines_t
)
is
l_scope logger_logs.scope%type := 'full_of_dml';
l_params logger.tab_param;
begin
View get-dynamic-date-range.sql
-- Pure SQL way to get dynamic date range instead of pipelined function
-- as shown here: https://twitter.com/cczarski/status/1500830480358330370
with
data as (
select
level insert_order,
decode(level,
1, 'Since Yesterday',
2, 'Last Week',
3, 'Last Month',