Tag Info

New answers tagged

1

You can not issue DDL commands (including ALTER) directly in PL/SQL. Use execute immediate instead. execute immediate 'Alter Trigger TEST.LIVE_DELETE Disable'; Replace DBMS_OUTPUT.PUT_LINE calls with logging to a table, as the output of the former will not appear anywhere in case of a scheduled job.


0

The data of a temporary table is only visible for the same session (or transaction, depending on the temp table properties) that wrote the data.


2

Sample data: create table offender ( fname varchar2(10), lname varchar2 (10), ssn number, chargeddate date ); insert into offender values ('A', 'A', 1, date'2015-08-01'); insert into offender values ('B', 'B', 2, date'2015-08-02'); insert into offender values ('C', 'C', 3, date'2015-08-03'); insert into offender values ('D', 'D', 4, ...


0

If you have duplicate inserts, the first question I would have would be why would you have two rows in the same table with the exact same information? That being said, if there are no unique keys or other such constraints on the table, the new DB server should dutifully import the duplicated data. I would heartily recommend testing it in a non production ...


2

You could calculate the percentage of the sum of a you've reached up till the current row, then segment that based on your thresholds. with pct as ( select a , (sum(a) over (order by a desc))/sum(a) over() pct from foo ) select a , pct , sum(a) over (partition by case when pct <= .6 then 'A' when pct <= .9 then 'B' else ...



Top 50 recent answers are included