![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to compile a stored procedure that is there with in a script file(.sql) in unix | krishna_gnv | Shell Programming and Scripting | 0 | 03-11-2008 12:25 AM |
| Executing Stored Proc from unix prompt. | arvindcgi | UNIX for Advanced & Expert Users | 0 | 01-29-2008 11:46 PM |
| Executing MS-SQL stored procedures from Unix/C Program? | mparks | SUN Solaris | 3 | 06-22-2007 11:29 AM |
| Where is my unix id stored in the system? | XZOR | UNIX for Dummies Questions & Answers | 4 | 07-31-2006 05:31 PM |
| Calling Oracle Stored Procedures in UNIx(sun solaris) | etravels | SUN Solaris | 0 | 03-23-2004 03:21 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Unix Stored Procdure
I have 2 stored procedures to be executed.
if the sysdate is between 12 am and 6 am i want to run procedure 1 else procedure 2 How do i do it with variables for time in the script. The DB is oracle Thanks |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Possibly add a script like this into your crontab. How often you want to run it in your crontab is entirely up to you and what you need this script to do...
Code:
#!/bin/bash
declare date=`date '+%H'`
if [ $date -le "6" ]
then {
echo "Time is before 6am"
your_procedure_1_here
exit 0;
}
else {
echo "Time is after 6am"
your_procedure_2_here
exit 0;
}
fi
exit 1;
|
|
#3
|
|||
|
|||
|
Quote:
DATE=`date '+%H'` if [ $DATE -le "6" ] |
|
#4
|
|||
|
|||
|
Quote:
That doesn't matter... |
|
#5
|
|||
|
|||
|
Quote:
However it improves the readability of your script enormously. |
|
#6
|
|||
|
|||
|
Quote:
yes, but reading a script you will be able to know the difference from a command and a variable. *shrug* if its a large script I can see why, but sometimes, when you are doing something simple, you are just doing something simple. |
|
#7
|
|||
|
|||
|
Quote:
Being clumsy just cause it is simple is never an argument there. Better get used to a habit of programming in a decent way, never cost you anything. |
|||
| Google The UNIX and Linux Forums |