BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'chain_job_1',
job_type => 'CHAIN',
job_action => 'my_chain1',
repeat_interval => 'freq=daily;byhour=13;byminute=0;bysecond=0',
enabled => TRUE);
END;
/
--С помощью регулярного выражения
select REGEXP_REPLACE('ДГН-04-13601/21-53', '-\d{1,}/', '-********/') from dual;
--Если строка всегда одной длины, то можно с помощью substr
select substr('ДГН-04-13601/21-53', 0, 7) || '********' || substr('ДГН-04-13601/21-53', 13) from dual;
GRANT INSERT, UPDATE, DELETE ON schema.tablename TO username; --Дать права
REVOKE INSERT, UPDATE, DELETE ON schema.tablename FROM username; --Отозвать права
create or replace trigger MY_TRIGGER_NAME
before insert or update or delete
on MY_TABLE_NAME
begin
if user in ( 'BAD_USER', 'ANGRY_USER' ) then raise_application_error( -20001,'You do not have access to modify this table.' );
end if;
end;
SELECT r.id,
c.relation_cpu_id cpu_hash,
LISTAGG(m.relation_monitor_id, ', ') WITHIN GROUP (ORDER BY m.id) AS monitor_hash
FROM report r
LEFT JOIN v_cpu_relation c ON r.id = c.relation_report_id
LEFT JOIN v_monitor_relation m ON r.id = m.relation_report_id
GROUP BY r.id,
c.relation_cpu_id