Fine, its seems that you are using Sybase DB then this would be the right syntax to create procedure (as already done by u)
As suggested by you, using SELECT you can able to store the return value, could you please print that value inside the SQL block and try to redirect it to one flat file. Based on the value we can manipulate using sed or awk command to get the exact return value.
Try like this,
Also provide me the content of that file (file_return_value)
Hi Siva,
Please find the content of the file below -
Thanks.
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 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)
Here's a shell script snippet.....
cd $ORACLE_HOME/bin
Retval=`sqlplus -s <<eof
$TPDB_USER/april@$TPD_DBCONN
whenever SQLERROR exit 2 rollback
whenever OSERROR exit 3 rollback
set serveroutput on
set pages 999
var status_desc char(200)
var status_code... (1 Reply)
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)
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)
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)
Discussion started by: vel4ever
6 Replies
LEARN ABOUT CENTOS
isql
isql(1) UnixODBC manual pages isql(1)NAME
isql, iusql - unixODBC command-line interactive SQL tool
SYNOPSIS
isql DSN [USER [PASSWORD]] [options]
DESCRIPTION
isql is a command line tool which allows the user to execute SQL in batch or interactively. It has some interesting options such as an
option to generate output wrapped in an HTML table.
iusql is the same tool with built-in Unicode support.
ARGUMENTS
DSN The Data Source Name, which should be used to make connection to the database. The data source is looked for in the /etc/odbc.ini
and $HOME/.odbc.ini files in that order, with the latter overwriting the former.
USER Specifies the database user/role under which the connection should be made.
PASSWORD
Password for the specified USER.
OPTIONS -b Run isql in non-interactive batch mode. In this mode, the isql processes its standard input, expecting one SQL command per line.
-dDELIMITER
Delimits columns with delimiter.
-xHEX Delimits columns with HEX, which is a hexadecimal code of the delimiting character in the format 0xNN - i.e. 0x09 for the TAB char-
acter.
-w Format the result as HTML table.
-c Output the names of the columns on the first row. Has any effect only with the -d or -x options.
-mNUM Limit the column display width to NUM characters.
-lLOCALE
Sets locale to LOCALE.
-q Wrap the character fields in double quotes.
-3 Use the ODBC 3 calls.
-n Use the newline processing.
-e Use the SQLExecDirect instead of Prepare.
-k Use SQLDriverConnect.
-v Turn on the verbose mode, where the errors are fully described. Useful for debugging.
--version
Prints the program version and exits.
COMMANDS
This section briefly describes some isql runtime commands.
help
List all tables in the database.
help table
List all columns in the table.
help help
List all help options.
EXAMPLES
$ isql WebDB MyID MyPWD -w -b < My.sql
Connects to the WebDB as user MyID with password MyPWD, then execute the commands in the My.sql file and returns the results wrapped in
HTML table. Each line in My.sql must contain exactly 1 SQL command, except for the last line, which must be blank (unless the -n option is
specified).
FILES
/etc/odbc.ini
System-wide DSN definitions. See odbc.ini(5) for details.
$HOME/.odbc.ini
User-specific DSN definitions. See odbc.ini(5) for details.
SEE ALSO odbcinst(1), odbc.ini(5)AUTHORS
The authors of unixODBC are Peter Harvey <pharvey@codebydesign.com> and Nick Gorham <nick@easysoft.com>. For the full list of contributors
see the AUTHORS file.
COPYRIGHT
unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the COPYING file.
version 2.3.1 Tue 25 Jun 2013 isql(1)