Home » Developer & Programmer » Forms » executing the code only one time every day
executing the code only one time every day [message #632787] Thu, 05 February 2015 12:15 Go to next message
hassan08
Messages: 122
Registered: June 2011
Location: egypt
Senior Member
i have a code and i putting it on trigger
when-new-form-instance
and i want if user open the screen more than one time
the code fire only one time every day
Re: executing the code only one time every day [message #632789 is a reply to message #632787] Thu, 05 February 2015 13:05 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
here's just one way, but it doesn't seem like a good idea, doesn't work well in a multi-user environment, plus do you want it to run once per user or once for the entire day?

put an identifier in a table when it executes, then you check to see if it has been set each time.
Re: executing the code only one time every day [message #632799 is a reply to message #632789] Thu, 05 February 2015 16:08 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What kind of code is it? What does it do? A database job sounds like a good option to do that (as it can be scheduled), if possible (i.e. maybe you can remove it from the WNFI trigger).
Re: executing the code only one time every day [message #632810 is a reply to message #632789] Thu, 05 February 2015 23:53 Go to previous messageGo to next message
hassan08
Messages: 122
Registered: June 2011
Location: egypt
Senior Member
joy_division wrote on Thu, 05 February 2015 13:05
here's just one way, but it doesn't seem like a good idea, doesn't work well in a multi-user environment, plus do you want it to run once per user or once for the entire day?

put an identifier in a table when it executes, then you check to see if it has been set each time.


i want to run once for entire day
Re: executing the code only one time every day [message #632951 is a reply to message #632810] Sun, 08 February 2015 10:20 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So, did you try Joy Division's suggestion? Mine? What's wrong with those options? If they don't work, explain why and we'll try to assist.

Besides, you aren't charged by number of letters you type. Feel free to explain the problem so that we could understand it better.
Re: executing the code only one time every day [message #632962 is a reply to message #632951] Mon, 09 February 2015 03:11 Go to previous messageGo to next message
hassan08
Messages: 122
Registered: June 2011
Location: egypt
Senior Member
i can't applied the previous idea
can give me example
Re: executing the code only one time every day [message #632964 is a reply to message #632962] Mon, 09 February 2015 03:33 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't have any.

Please, post what you have already tried, and we'll help you develop the idea.
Re: executing the code only one time every day [message #632969 is a reply to message #632787] Mon, 09 February 2015 04:22 Go to previous message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

one suggestion , not sure it will work well or not.

you can make a table like:-
create table abc
(sno number,
code_exe_date date default sysdate)

now you can make a procedure before executing a query it should check that today's date is existing in abc table or not, IF not then it should execute the query and insert max(sno)+1 into abc table in "sno" column. (date will get inserted automatically).
and what should be the ELSE part you know very well.

I think this logic may help. Smile

[Updated on: Mon, 09 February 2015 04:23]

Report message to a moderator

Previous Topic: CALENDAR in Oracle Forms
Next Topic: how to concatenate value in procedure name using parameter at runtime
Goto Forum:
  


Current Time: Mon May 06 09:16:35 CDT 2024