Skip to content

Instantly share code, notes, and snippets.

View rmorenobello's full-sized avatar

Raúl Moreno Bello rmorenobello

View GitHub Profile
@rmorenobello
rmorenobello / ODI - Repo - Warnings (SLT).sql
Last active December 12, 2024 15:48
Oracle Data Integrator (ODI) - useful queries, management, admin
-- Errors en el sentit de Warnings per files desviades a taules d'error E$.
-- Connexió: BISLT_PRO_WORKREP
select
--sc_par_par_folder.SCEN_FOLDER_NAME
sc_parent_folder.SCEN_FOLDER_NAME
, SNP_SCEN_REPORT.CONTEXT_CODE
, SNP_SCEN_REPORT.SESS_BEG
, ROUND(SNP_SCEN_REPORT.SESS_DUR/60) as DUR_MINS
, SNP_SCEN.SCEN_NAME
, SNP_SCEN.SCEN_VERSION
@rmorenobello
rmorenobello / OracleDB-TableINFO
Last active February 13, 2025 14:00
OracleDB - Info on constraints, indexs, partitions, subpartitions, ...
-- *******
-- Taules
-- *******
SELECT * FROM ALL_TABLES WHERE OWNER = 'BI_JUS' AND TABLE_NAME = 'JUS_MO_OF_TRA_TRAMITS';
-- *****************
-- COLUMN STATISTICS
-- *****************
-- Martin Widlake mdw 21/03/2003
-- MDW 11/12/09 enhanced to include more translations of low_value/high_value
@rmorenobello
rmorenobello / Oracle DB - GRANT all objects to.sql
Last active June 5, 2020 09:39
Oracle Database - DB Administration
-- Script per obtenir les sentencies que donarien tots els grants sobre cada objecte
-- de l'esquema indicat &&schema_name a l'usuari indicat &&grantee_name:
set heading off pagesize 0 feedback off echo off verify off linesize 200
-- Getting the user schema we want privileges from
accept schema_name char prompt 'Application Schema Name:'
-- Getting the user schema we want to grant privileges to
accept grantee_name char prompt 'Grants to user :'
@rmorenobello
rmorenobello / 10 - ORACLE tricks.sql
Last active September 9, 2024 11:09
ORACLE DB - snippets, tips, best practices
-- ¡¡¡¡Resumenes con ejemplos de cada tema!!!!
http://www.morganslibrary.org/library.html
https://lalitkumarb.wordpress.com/2014/05/31/oracle-explain-plan/
-- EXPLAIN PLAN FOR
-- per consultar resultat:
set linesize 132;
SELECT * FROM TABLE(dbms_xplan.display);
@decidedlygray
decidedlygray / py_b64unicode_decode.py
Created December 14, 2017 15:26
Python2 snippet for taking a base64-encoded unicode string, and decoding it properly so there aren't trailing null bytes on ASCII characters
#!/usr/bin/env python
"""
Python2 snippet for taking a base64-encoded unicode string, decoding it
properly so there aren't trailing null bytes for ASCII characters
Leaving this here so I don't have to look it up again
@decidedlygray
"""
@santisbon
santisbon / Search my gists.md
Last active May 5, 2025 21:07
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@rmorenobello
rmorenobello / multipleAggregateFunctions_SingleQuery_diffsWHEREs.sql
Last active May 6, 2017 20:33
Calculate Multiple Aggregate Functions (with diff combinations of fixed WHERE conditions) in a Single Query
-- https://dzone.com/articles/how-to-calculate-multiple-aggregate-functions-in-a?edition=297992
-- Calculate Multiple Aggregate Functions (diff WHERE conditions) in a Single Query
-- ***************** PROBLEM to solve:
-- Number of films with a given length / language_id
SELECT count(*)
FROM film
WHERE length BETWEEN 120 AND 150
AND language_id = 1;
-- Number of films with a given length / rating
@rmorenobello
rmorenobello / CORRECT_StringConcat_predicate_Trick.sql
Last active May 22, 2024 13:51
Don't Use the String Concatenation Trick in SQL Predicates
-- NOTA: no recuerdo por qué todo esto en lugar de un simple join ?!?!?!
-- DO NOT DO THIS!!!
CREATE INDEX idx_customer_name ON customer (last_name, first_name);
SELECT *
FROM customer
WHERE first_name || last_name IN (
SELECT first_name || last_name
FROM actor
PROJECT_DIR=/home/pentaho/projects
KETTLE_REDIRECT_STDERR=Y
KETTLE_REDIRECT_STDOUT=Y
KETTLE_MAX_LOGGING_REGISTRY_SIZE=10000
KETTLE_LOG_MARK_MAPPINGS=Y
KETTLE_JOB_LOG_SCHEMA=pentaho_dilogs
KETTLE_JOB_LOG_DB=live_logging_info
KETTLE_JOB_LOG_TABLE=job_logs
@susanBuck
susanBuck / programA.py
Last active January 13, 2022 10:39
Python Module Name Example
# The technical term for a text file of Python code (what we've been creating all semester) is a module.
#
# This file you're looking at right now, programA.py, is a module.
#
# The file name acts as the module name.
# I.e. for this file programA.py, the corresponding module name is `programA`.
#
# That's why if we wanted to import this file into another file, we'd just say `import programA`, not `import programA.py`
#
# Ok, now that we know what a module is, let's look towards what __name__ is...