Getting Yesterdays or Tomorrows day with shell date command
$ date --date='2 year ago' # past
$ date --date='3 years' # go into future
$ date --date='2 days' # future
$ date --date='1 month ago' # past
$ date --date='2 months' # future
$ date --date='2 year ago' # past
$ date --date='3 years' # go into future
$ date --date='2 days' # future
$ date --date='1 month ago' # past
$ date --date='2 months' # future
create or replace procedure delete_duplicate is
cursor c is select sn from tmp_data a where a.sn in (select sn from tmp_duplicate);
type c1_type is table of c%rowtype;
l_c1 c1_type;
begin
open c;
loop
fetch c bulk collect into l_c1 LIMIT 1000;
for i in 1 .. l_c1.count
loop
--Expecting to do the delete
dbms_output.put_line('Delete this ' || l_c1(i).sn);
end loop;
dbms_output.put_line('----------------------');
exit when c%notfound;
end loop;
close c;
end delete_duplicate;
UPDATE INCOMING_LEAD
SET (INCOMING_LEAD.DEPARTMENT_CD, INCOMING_LEAD.PROGRAM_CD,
INCOMING_LEAD.EFFORT_CD, INCOMING_LEAD.OFFER_CD) =
(SELECT OFFER_INPUT_KEYCODE.DEPARTMENT_CD,
OFFER_INPUT_KEYCODE.PROGRAM_CD, OFFER_INPUT_KEYCODE.EFFORT_CD,
OFFER_INPUT_KEYCODE.OFFER_CD
FROM OFFER_INPUT_KEYCODE
WHERE OFFER_INPUT_KEYCODE.INPUT_KEYCODE =
INCOMING_LEAD.PROMO_INITIAL_KEYCODE)
If you find yourself stuck with over 30,000 files in a directory (text files in this example), packing them into a tar file can be tricky. You can get around it with this:
find . -name '*.txt' -print >/tmp/test.manifest
tar -cvzf textfiles.tar.gz --files-from /tmp/test.manifest
find . -name '*.txt' | xargs rm -v
If you find yourself stuck with over 30,000 files in a directory (text files in this example), packing them into a tar file can be tricky. You can get around it with this:
find . -name '*.txt' -print >/tmp/test.manifest
tar -cvzf textfiles.tar.gz --files-from /tmp/test.manifest
find . -name '*.txt' | xargs rm -v
| ID | Mobileno | created |
| 1 | +90990 | 01-FEB-06 |
| 2 | +90990 | 02-FEB-06 |
| 3 | +90991 | 02-FEB-06 |
| 4 | +90991 | 01-FEB-06 |
| ID | Mobileno | created |
| 2 | +90990 | 02-FEB-06 |
| 3 | +90991 | 02-FEB-06 |