Skip to content

Instantly share code, notes, and snippets.

Avatar

tschf tschf

View GitHub Profile
View gist:d5eb35ba39495e69a9990957dc2c4af3
List<SystemVersion> installedVersions = new List<SystemVersion>();
installedVersions.Add(new SystemVersion("system17.1.123.1256"));
installedVersions.Add(new SystemVersion("system17.2.0.188.1159"));
installedVersions.Add(new SystemVersion("system4.2.123.1256"));
List<SystemVersion> sortedVersions =
installedVersions
.OrderByDescending(o=>o.BuildNumber.Major)
.ThenByDescending(o=>o.BuildNumber.Minor)
.ThenByDescending(o=>o.BuildNumber.MajorRevision)
@tschf
tschf / script.sql
Last active May 7, 2017
Oracle: case with a tuple (object)
View script.sql
create type ot_info is object (
a number,
b number,
c number,
map member function equals return raw
);
/
create type body ot_info as
@tschf
tschf / query.sql
Created Sep 2, 2016
SLK-581 Linkage in SQL
View query.sql
set sqlformat ansiconsole
--See: http://www.aihw.gov.au/WorkArea/DownloadAsset.aspx?id=60129551915
--http://meteor.aihw.gov.au/content/index.phtml/itemId/349510
with raw_data as (
select
upper('Smith') last,
upper('Nicholas') first,
to_date('29-01-1959', 'dd-mm-yyyy') dob,
'M' gender
from dual
@tschf
tschf / README.md
Created Aug 31, 2016
Atom fresh sessions
View README.md

Atom has a config not in the UI: core.restorePreviousWindowsOnStart.

Set this to false in your config.cson file in order to start Atom in a blank state when you launch Atom.

View gist:0e75f798c5b6be79ef21
$ /home/trent/node-v0.12.2-linux-x64/bin/node app.js dev 110
options { configFile: '/home/trent/apex-diff/config/config.json',
sqlcl: '/opt/sqlcl/bin/sql',
debug: true,
rebuildTempFile: false,
connections:
{ dev: 'dl_test/dl_test@localhost/xe',
prod: 'dl_prod/dl_prod@localhost/xe' } }
sql: { command: '%SQLCL% %CONNECTION% @%DIRECTORY%/%FILENAME% %PARAMS%',
files:
@tschf
tschf / download.sql
Created Aug 10, 2015
Download file with wpg_docload
View download.sql
declare
l_file files%rowtype;
begin
select *
into l_file
from files
where id = 261;
owa_util.mime_header(l_file.mime_type);
@tschf
tschf / ORDS.md
Last active Aug 29, 2015
Using SSH Connections for ORDS Admin
View ORDS.md

I set up the the SSH profile:

See: sshprofile.png

Then I can set up the connection by specifying the type as SSH, successfully:

See: ssh_connection_test.png

However, in the REST Admin, I don't get the SSH connection option:

@tschf
tschf / SQL*Plus pipe.md
Last active Jan 12, 2016
Piping values to SQL*Plus script doesn't work with a HIDE accept param
View SQL*Plus pipe.md

Piping in input doesn't seem to work when having one HIDE param and one non-HIDE param - refer to sql script below https://gist.github.com/trent-/1c2bb55da5045113498e#file-ords_manual_install-sql

Scenario 1: Both accepts are non-HIDE.... works fine
Scenario 2: Both accepts are HIDE.... works fine
Scenario 2: At least one is HIDE and one isn't.... doesn't work
Scenario 3: Only one param (HIDE or non-HIDE doesn't matter).... works fine

Call script:

@tschf
tschf / apex_session_utl.sql
Last active Aug 29, 2015
Package to re initialise an existing Application Express session from SQL Developer
View apex_session_utl.sql
/* Usage:
Package to get an apex session from SQL Developer (or other external tool) based on an existing session ID.
Useful to have parameterised views return data
--Get session in SQL Dev, replacing xxxxxxxxx with your actual session
begin
apex_session_utl.re_init_session('xxxxxxxxx');
end;
@tschf
tschf / google_drive.pkb
Last active Jun 20, 2019
google_drive in plsql
View google_drive.pkb
create or replace
PACKAGE GOOGLE_DRIVE
as
type t_varchar2 is table of varchar2(50);
-- Set default folder ID to upload to (got from last portion of URL when opening folder)
g_upload_folder_id varchar2(400) := '';
procedure get_authorization_url(
You can’t perform that action at this time.