Skip to content

Instantly share code, notes, and snippets.

View arbo-hacker's full-sized avatar

Alejandro Barreto arbo-hacker

View GitHub Profile
@arbo-hacker
arbo-hacker / mfqueue-tables-retek.sql
Created January 23, 2016 05:48
Como monitorear las tablas MFQUEUE en Oracle Retail
select 'CODES_MFQUEUE' COLA, count(1) ENCOLADOS from CODES_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'RUA_MFQUEUE' COLA, count(1) ENCOLADOS from RUA_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'BANNER_MFQUEUE' COLA, count(1) ENCOLADOS from BANNER_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'ITEM_MFQUEUE' COLA, count(1) ENCOLADOS from ITEM_MFQUEUE I WHERE PUB_STATUS = 'U' AND I.APPROVE_IND = 'Y' union all
select 'SEEDOBJ_MFQUEUE' COLA, count(1) ENCOLADOS from SEEDOBJ_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'WH_MFQUEUE' COLA, count(1) ENCOLADOS from WH_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'STORE_MFQUEUE' COLA, count(1) ENCOLADOS from STORE_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'SUPPLIER_MFQUEUE' COLA, count(1) ENCOLADOS from SUPPLIER_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'TSF_MFQUEUE' COLA, count(1) ENCOLADOS from TSF_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'PARTNER_MFQUEUE' COLA, count(1) ENCOLADOS from PARTNER_MFQUEUE WHERE PUB_STATUS = 'U' union al
@arbo-hacker
arbo-hacker / eliminar-concurrente.sql
Created January 23, 2016 05:41
Como eliminar un concurrente de Oracle Financials / EBS / E-Business Suite
DECLARE
-- Change the following two parameters to fit your needs
p_progShortName VARCHAR2 (100) := '&nombre del concurrente'; -- este debe ser obtenido de la tabla fnd_concurrent_programs
p_forceDelete BOOLEAN := TRUE;
num_programID NUMBER;
var_progName VARCHAR2 (100);
num_appID NUMBER;
num_execID NUMBER;
num_appIDName VARCHAR2 (100);
@arbo-hacker
arbo-hacker / Registros numericos.sql
Last active January 23, 2016 04:53
Como saber si el valor de un campo es numerico en PL/SQL
-- Obtener todos los registros que son alfanumericos
select * from (
select '123' campo from dual
union all
select '1X2' from dual
) tmp
where translate(campo,'T 0123456789','T') is not null;
-- Obtener todos los registros que son numericos
select * from (
@arbo-hacker
arbo-hacker / FNC_FILENAME.sql
Last active January 23, 2016 04:52
Funcion para obtener nombre de archivo
CREATE OR REPLACE FUNCTION FNC_FILENAME (ruta_archivo VARCHAR2,
barra VARCHAR2,
extension VARCHAR2)
RETURN VARCHAR2
IS
BEGIN
RETURN REGEXP_SUBSTR (ruta_archivo,
'[^' || barra || ']+.' || extension,
1,
1);