Sponsored Content
Top Forums Shell Programming and Scripting Execute stored procedure through script in sybase database and store the output in a .csv file Post 302435452 by amit.mathur08 on Wednesday 7th of July 2010 11:39:58 AM
Old 07-07-2010
Question

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

Execute an Oracle stored procedure from a shell scrip

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

execute store procedure

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

How to compile a stored procedure that is there with in a script file(.sql) in unix

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

how to store the return values of stored procedure in unix shell script.

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

Call and redirect output of Oracle stored procedure from unix script

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

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

Shell Linux to connect to a database and execute store procedure

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

Unable to execute Stored Procedure from CRON

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

ksh and Oracle stored procedure output in logfile

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

Calling a Sybase Stored procedure from a UNIX Script

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
SYBASE_SET_MESSAGE_HANDLER(3)											     SYBASE_SET_MESSAGE_HANDLER(3)

sybase_set_message_handler - Sets the handler called when a server message is raised

SYNOPSIS
bool sybase_set_message_handler (callable $handler, [resource $link_identifier]) DESCRIPTION
sybase_set_message_handler(3) sets a user function to handle messages generated by the server. You may specify the name of a global func- tion, or use an array to specify an object reference and a method name. PARAMETERS
o $handler - The handler expects five arguments in the following order: message number, severity, state, line number and description. The first four are integers. The last is a string. If the function returns FALSE, PHP generates an ordinary error message. o $link_identifier - If the link identifier isn't specified, the last opened link is assumed. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 sybase_set_message_handler(3) callback function <?php function msg_handler($msgnumber, $severity, $state, $line, $text) { var_dump($msgnumber, $severity, $state, $line, $text); } sybase_set_message_handler('msg_handler'); ?> Example #2 sybase_set_message_handler(3) callback to a class <?php class Sybase { function handler($msgnumber, $severity, $state, $line, $text) { var_dump($msgnumber, $severity, $state, $line, $text); } } $sybase= new Sybase(); sybase_set_message_handler(array($sybase, 'handler')); ?> Example #3 sybase_set_message_handler(3) unhandled messages <?php // Return FALSE from this function to indicate you can't handle // this. The error is printed out as a warning, the way you're used // to it if there is no handler installed. function msg_handler($msgnumber, $severity, $state, $line, $text) { if (257 == $msgnumber) { return false; } var_dump($msgnumber, $severity, $state, $line, $text); } sybase_set_message_handler('msg_handler'); ?> NOTES
Note This function is only available when using the CT library interface to Sybase, and not with the DB library. PHP Documentation Group SYBASE_SET_MESSAGE_HANDLER(3)
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy