07-07-2010
hi.
I have tried this but no luck because I need to pass the parameters also to the stored procedure from the unix script.
For more details, below are the details, I need to do:
1.) Connect to the database by loginid and username
2.) Call the procedure and pass the input parameter that is $end_date = getdate and $start_date = getdate - 7 days
3.) Procedure has to execute based on the above parameters
4.) Output should store in a .csv file.
Please assist.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Here is a snippet of my code:
if
then
echo "\n Deleting all reports older than 24 hours. \n" >> $logfile
ls -l $FileName >> $logfile
... (1 Reply)
Discussion started by: mh53j_fe
1 Replies
2. UNIX for Dummies Questions & Answers
Hi, can someone point out the tutorial or syntax for how to execute store procedure through shell scripting .
thanks. (7 Replies)
Discussion started by: epall
7 Replies
3. Shell Programming and Scripting
Hi,
How can i compile the procedure code that is there in a script file (.sql) in unix. (0 Replies)
Discussion started by: krishna_gnv
0 Replies
4. Shell Programming and Scripting
hi
i am calling a oracle stored procedure(in the database) from unix shell scripting (a.sh).
the called stored procedure returns some values through OUT variables
i want to assign the return values of stored procedure in to unix shell script variable.
can you provide me the code.
... (1 Reply)
Discussion started by: barani75
1 Replies
5. Shell Programming and Scripting
Hi,
Can you assist me in how to redirect the output of oracle stored procedure from unix script?
Something similar to what i did for sybase
isql -U$MYDBLOG -D$MYDBNAME -S$MYDBSVR -P$MYDBPWD -o$MYFILE<< %%
proc_my_test 8
go
%%
Thanks in advance - jak (0 Replies)
Discussion started by: jakSun8
0 Replies
6. Shell Programming and Scripting
How to execute the stored procedure from shell script and is there any possibility to print the dbms output in a log file. (2 Replies)
Discussion started by: dineshmurs
2 Replies
7. Shell Programming and Scripting
HI,
i want to write a script (Linux) that:
1) connect to a database oracle
2) execute some store procedure.
Can anybody help me, please?
Thanks a lot
Andrew (3 Replies)
Discussion started by: manichino74
3 Replies
8. Shell Programming and Scripting
Hi,
I am very new to this environment - I hope this is the right platform to discuss my issue:
I created a CRON job to run a Stored Procedure from our database - Sybase.
Within the Stored Procedure there is a TRUNCATE table and CREATE table function.
the CRON job fails to run with... (2 Replies)
Discussion started by: pizzazzz
2 Replies
9. Shell Programming and Scripting
Friends,
I pass some runtime arguments (date, number) through ksh script to Oracle procedure, use input value and pass it on to procedure.
Oracle procedure gets input value, run query and logs everything in the logfile.
I'm facing with couple of challenges
1. Even though I pass all... (5 Replies)
Discussion started by: homer4all
5 Replies
10. How to Post in the The UNIX and Linux Forums
Hi, I am new to shell scripting and Sybase database i need a help that i try to execute a SYBASE stored procedure from a Unix shell script and wanna write the output of the SP into a Text File.somehow i try to find a solution but whwn i try to run the script i am not getting the output file with... (1 Reply)
Discussion started by: Arun619
1 Replies
LEARN ABOUT REDHAT
getdate_r
GETDATE(3) Linux Programmer's Manual GETDATE(3)
NAME
getdate() - convert a string to struct tm
SYNOPSIS
#define _XOPEN_SOURCE
#define _XOPEN_SOURCE_EXTENDED
#include <time.h>
struct tm *getdate (const char *string);
extern int getdate_err;
#define _GNU_SOURCE
#include <time.h>
int getdate_r (const char *string, struct tm *res);
DESCRIPTION
The function getdate() converts a string pointed to by string into the tm structure that it returns. This tm structure may be found in
static storage, so that it will be overwritten by the next call.
In contrast to strptime(3), (which has a format argument), getdate() uses the formats found in the file of which the full path name is
given in the environment variable DATEMSK. The first line in the file that matches the given input string is used for the conversion.
The matching is done case insensitively. Superfluous whitespace, either in the pattern or in the string to be converted, is ignored.
The conversion specifications that a pattern can contain are those given for strptime(3). One more conversion specification is accepted:
%Z Timezone name.
When %Z is given, the value to be returned is initialised to the broken-down time corresponding to the current time in the given time zone.
Otherwise, it is initialised to the broken-down time corresponding to the current local time.
When only the weekday is given, the day is taken to be the first such day on or after today.
When only the month is given (and no year), the month is taken to be the first such month equal to or after the current month. If no day
is given, it is the first day of the month.
When no hour, minute and second are given, the current hour, minute and second are taken.
If no date is given, but we know the hour, then that hour is taken to be the first such hour equal to or after the current hour.
RETURN VALUE
When successful, this function returns a pointer to a struct tm. Otherwise, it returns NULL and sets the global variable getdate_err.
Changes to errno are unspecified. The following values for getdate_err are defined:
1 The DATEMSK environment variable is null or undefined.
2 The template file cannot be opened for reading.
3 Failed to get file status information.
4 The template file is not a regular file.
5 An error is encountered while reading the template file.
6 Memory allocation failed (not enough memory available).
7 There is no line in the file that matches the input.
8 Invalid input specification.
NOTES
Since getdate() is not reentrant because of the use of getdate_err and the static buffer to return the result in, glibc provides a thread-
safe variant. The functionality is the same. The result is returned in the buffer pointed to by res and in case of an error the return
value is nonzero with the same values as given above for getdate_err.
The POSIX 1003.1-2001 specification for strptime() contains conversion specifications using the %E or %O modifier, while such specifica-
tions are not given for getdate(). The glibc implementation implements getdate() using strptime() so that automatically precisely the same
conversions are supported by both.
The glibc implementation does not support the %Z conversion specification.
ENVIRONMENT
DATEMSK
File containing format patterns.
TZ, LC_TIME
Variables used by strptime().
CONFORMING TO
ISO 9899, POSIX 1003.1-2001
SEE ALSO
localtime(3), strftime(3), strptime(3), time(3)
2001-12-26 GETDATE(3)