shell scripts cannot call Oracle stored procedures directly, and Oracle stored procedures (by default) do not return record sets.
Shell scripts can launch SQL*Plus and pass the name of a *.sql file for SQL*Plus to run, and that *.sql file can call a stored procedure, so indirectly shell scripts can run stored procedures.
Oracle stored procedures can return "ref cursors", but what do you want to do with (or, how will you use) the record set that you want the stored procedure to return?
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)
hi all
please tell me how to pass parameters 4m shell script to a DataBase stored procedure.
To be specific i have sybase DB.
i mean i want the syntax of the command..
how to connect to DB, pass user id and password, pass the required parameter to SP..
..
need ur help frnds..
hema (0 Replies)
Hi Dudes :)
I want a unix shell script to pass value to SQL stored procedure.
Below is the procedure
declare
res varchar2(10);
begin
odm_load_check('PRE_SANITY',res);
dbms_output.put_line(res);
end;
select * from error_log;
truncate table error_log;
select * from test; (1 Reply)
Hi,
I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output.
I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
I have written a stored procedure in oracle database, which is having a CLOB OUT parameter. How can i call this stored procedure from shell script and get the CLOB object in shell script variable? (0 Replies)
I am invoking a SQL script from shell script. This SQL script will invoke a stored procedure(which has the OUT parameter). I want to have the OUT parameter in the shell script as a variable. Is this possible? (6 Replies)
Hello all,
I am trying to run stored procrdure from shell script which takes one argument. And also I want to verify in the script whether the script executed successfully. However the Stored procedure is not running from shell script. Manually if I run it update the data in the table.
Can... (29 Replies)
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
LEARN ABOUT PHP
odbc_prepare
ODBC_PREPARE(3) 1 ODBC_PREPARE(3)odbc_prepare - Prepares a statement for executionSYNOPSIS
resource odbc_prepare (resource $connection_id, string $query_string)
DESCRIPTION
Prepares a statement for execution. The result identifier can be used later to execute the statement with odbc_execute(3).
Some databases (such as IBM DB2, MS SQL Server, and Oracle) support stored procedures that accept parameters of type IN, INOUT, and OUT as
defined by the ODBC specification. However, the Unified ODBC driver currently only supports parameters of type IN to stored procedures.
PARAMETERS
o $connection_id
-The ODBC connection identifier, see odbc_connect(3) for details.
o $query_string
- The query string statement being prepared.
RETURN VALUES
Returns an ODBC result identifier if the SQL command was prepared successfully. Returns FALSE on error.
EXAMPLES
Example #1
odbc_execute(3) and odbc_prepare(3) example
In the following code, $success will only be TRUE if all three parameters to myproc are IN parameters:
<?php
$a = 1;
$b = 2;
$c = 3;
$stmt = odbc_prepare($conn, 'CALL myproc(?,?,?)');
$success = odbc_execute($stmt, array($a, $b, $c));
?>
If you need to call a stored procedure using INOUT or OUT parameters, the recommended workaround is to use a native extension for your
database (for example, mssql for MS SQL Server, or oci8 for Oracle).
SEE ALSO odbc_execute(3).
PHP Documentation Group ODBC_PREPARE(3)