Home » SQL & PL/SQL » SQL & PL/SQL » recursive date problem (Merged 3)
recursive date problem (Merged 3) [message #315531] Mon, 21 April 2008 19:02 Go to next message
satya kamarajugadda
Messages: 3
Registered: April 2008
Location: Melbourne
Junior Member
Hi all,
I'm trying to update last months data on 1st weekend of this month and has to be done every month repeatedly.

select to_char(trunc(sysdate,'month')-1,'SYYYY-MM-DD')|| 'HH24:MI:SS' last_month;

Having problems with this query, can someone help me with this..!
Re: URGENT [message #315534 is a reply to message #315531] Mon, 21 April 2008 19:20 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
> URGENT
URGENT? Please explain why it is urgent for me to a solve this problem for you?


SQL Experts
Advanced Oracle SQL questions - Complex queries, DML and DDL statements. Newbies should not post to this forum!
Newbies should not post to this forum!
Newbies should not post to this forum!
Newbies should not post to this forum!

We have NO idea about your data.
We have NO idea about your table(s).

Read & following posting guidelines in URL below
http://www.orafaq.com/forum/t/88153/0/
Recursive month update [message #315616 is a reply to message #315531] Tue, 22 April 2008 03:37 Go to previous messageGo to next message
satya kamarajugadda
Messages: 3
Registered: April 2008
Location: Melbourne
Junior Member
Hi All,

can anyone help me with this situation:
we have a table with 3 million records and updation b done every next month of 1st weekend of last month's records.

create package ..
as procedure .. /
create package body..
as procedure..is
begin
insert into table_name
select .........
from user.view_name
where month=to_char(trunc(sysdate,'month')-1,'YYYY-MM-DD')last_month

cheers
Re: Recursive month update [message #315619 is a reply to message #315616] Tue, 22 April 2008 03:56 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Don't multipost and don't cross-post.
There is a direct relation between the number of times you create a new thread about the same problem and the number of serious responses..
Re: Recursive month update [message #315631 is a reply to message #315616] Tue, 22 April 2008 04:38 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Still you have not told us what exactly your problem. All I could see from your post you want to do an update for last month data in the first week of current month. You have explained what you want to do. But what you have not told us where you are stuck or what is your problem. Each and every answer will be as good as your question. So bear that in mind and start again.

Regards

Raj
Re: Recursive month update [message #315636 is a reply to message #315631] Tue, 22 April 2008 04:53 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
S.Rajaram wrote on Tue, 22 April 2008 11:38
and start again.

... in a REPLY to this thread!
Re: Recursive month update [message #315667 is a reply to message #315636] Tue, 22 April 2008 06:15 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Yes I did mean that. I should have been more clear on my reply. Apologies for that Smile

Regards

Raj
Re: Recursive month update [message #315675 is a reply to message #315667] Tue, 22 April 2008 06:35 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Nah, no need. I knew you do understand, but not sure about the original poster
Re: Recursive month update [message #315691 is a reply to message #315619] Tue, 22 April 2008 07:46 Go to previous messageGo to next message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
Frank wrote on Tue, 22 April 2008 04:56
Don't multipost and don't cross-post.
There is a direct relation between the number of times you create a new thread about the same problem and the number of serious responses..


You probably meant a "direct inverse relation" Wink
Re: Recursive month update [message #315805 is a reply to message #315631] Tue, 22 April 2008 16:58 Go to previous messageGo to next message
satya kamarajugadda
Messages: 3
Registered: April 2008
Location: Melbourne
Junior Member
Hi,
with the code here, not able to get the recent update from month field. all I can see is the whole months of last days
select to_char(trunc(sysdate,'month')-1,'SYYYY-MM-DD')|| 'HH24:MI:SS' last_month


Thanks
Re: Recursive month update [message #315806 is a reply to message #315805] Tue, 22 April 2008 17:03 Go to previous messageGo to next message
pablolee
Messages: 2836
Registered: May 2007
Location: Scotland
Senior Member
Your question still makes no sense. At all. There is obviously a bit of a language barrier here. I see that you appear to be posting in Australia, you might want to ask one of your colleagues to translate your question for you (if you can get them to understand you requirement) other than that, go and read the posting guidelines and post sample data and expected results. That may help clarify the question.

[Updated on: Tue, 22 April 2008 17:03]

Report message to a moderator

Re: Recursive month update [message #315995 is a reply to message #315805] Wed, 23 April 2008 07:56 Go to previous message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
satya kamarajugadda wrote on Tue, 22 April 2008 17:58

select to_char(trunc(sysdate,'month')-1,'SYYYY-MM-DD')|| 'HH24:MI:SS' last_month


Thanks



what is the purpose of that code?
orcl10g FOO>l
  1  select to_char(trunc(sysdate,'month')-1,'SYYYY-MM-DD')|| 'HH24:MI:SS' last_month
  2*  from dual
orcl10g FOO>/

LAST_MONTH
---------------------
 2008-03-31HH24:MI:SS
Previous Topic: Dynamic SQL for this SQL?
Next Topic: Need help validating a credit card
Goto Forum:
  


Current Time: Sat Dec 10 05:30:27 CST 2016

Total time taken to generate the page: 0.23578 seconds