I work quite a bit with MySQL in Unix so I might be able to help you. Without knowing exactly what you are trying to accomplish I can't be 100% sure what I say will be your solution but it might be a starting block.
Just to state the obvious (maybe) you can execute a mysql command from a shell script by using the -e flag.... example
Now you could call your stored procedure from a .sql file in which case I believe the following would work for you
the redirection could be replaced with something else or whatever you want to do with your output.
If this doesn't work then just let me know more what you're trying to achieve and I can try and help you better.
Hi All,
This is a very starnge problem I am having. I have a shell script that calls a stored procedure.
Here's my code in shell script:
sqlplus "userid/pwd" @file.sql
and file.sql has the following statement:
exec my_storedProc;
Now, when I execute my shell script, nothing... (2 Replies)
HI,
I have a similar problem to thread 18264, only I couldn't get it to work.
https://www.unix.com/showthread.php?t=18264
I have a stored procedure which is called by a shell script program. When I run the stored procedure alone or through the shell script, it works fine with output text... (3 Replies)
hai,
can anybody say how to call or to execute an oracle stored procedure in oracle from unix...
thanks in advance.... for ur reply....
by,
leo (2 Replies)
Hi,
Can anyone please let me know where to check if a particular stored procedure exists.
If the procedure exists I want to display some message and if the procedure does not exists i want to exit with error message.
checking from dba_objects doesnt help. suprisingly the procedure i... (3 Replies)
Hi,
My stored procedure returns a value.
How to retrieve the value and display in unix.
Stored procedure
CREATE OR REPLACE
PROCEDURE gohan(num INT) IS
BEGIN
DBMS_OUTPUT.PUT_LINE('My lucky number is ' || num);
END;
Unix Scripting i used
sqlplus -s... (7 Replies)
Hi,
I want to create MySQL stored procedure and call the stored procedure using perl.
I tried like this:
use DBI;
my $dbh = DBI->connect ("DBI:mysql:test",
"root", "ibab",
{ RaiseError => 1, PrintError => 0});
$create_procedure =... (5 Replies)
Friends,
I'm newbie with ksh so wanting some help....
1. I'm trying to call oracle stored procedure from ksh script by taking variable value from runtime, feed into script and execute procedure.
2. Put name1 and name2 value from script run replacing $3 & $4
I'm trying to put name1 in... (4 Replies)
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)