09-22-2002
Update
You need to define the bind variables to SQLPLUS and set a unix variable to contain the returned variables, then parse them in unix using something like awk or cut
In Unix:
======
ERROR_NO_OUT=0
ERROR_TEXT_NO="N/A"
l_string_returned = `sqlplus -s ${DB_UNAME}/${DB_UPSWD}@${DB_NAME} << END_OF_SQL
-- define them
var error_no_out number := $ERROR_NO_OUT;
var error_test_no varchar2 := $ERROR_TEXT_NO;
exec psit_ba_upload_pkg.apply_jobs('18/09/2002',:ERROR_NO_OUT, :ERROR_TEXT_NO);
print :error_no_out,:error_text_out;
END_OF_SQL`
Echo $l_string_returned
-- parse em out here to unix varaiables using awk or cut.
#echo "ERROR_NO_OUT=$ERROR_NO_OUT\n"
#echo "ERROR_TEXT_NO=$ERROR_TEXT_NO\n"
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
sample code as following:
test_sql(){
#test#echo test_sql
str=`$ORACLE_BIN/sqlplus -s $user/$passwd <<EOM
set verify off
set heading off
set feedback off
#--------start pl/sql
{
DECLARE
CURSOR pah_cs IS
select id from table
where letter = 'abcd';... (6 Replies)
Discussion started by: YoYo
6 Replies
2. UNIX for Advanced & Expert Users
Hi All
I would be thankful to you all if you will guide me the steps to call a stored proc. from unix shell script. that stored proc. could be parameterised or parameterless developed in SQL.
Any info. in this topic would help me.....
Thanks in advance.... (1 Reply)
Discussion started by: varungupta
1 Replies
3. Shell Programming and Scripting
Hi,
I need to make SQL Server procedure call (exec <proc name>)from unix shell script. First of all I would like to know if it is possible. I know we can do it from Oracle but not sure about SQL Server.
Version:
SunOS 5.8
SQL 8.0
I have made the below entry in the interface file.
NSXNA267
... (0 Replies)
Discussion started by: sspreethi
0 Replies
4. Shell Programming and Scripting
hi,
I want to know how to call a pl sql function testfunction(param1,..) that returns a value and grab that value in a shell variable.
Thnx in advance
---------- Post updated 03-30-10 at 11:58 AM ---------- Previous update was 03-29-10 at 03:49 PM ----------
thnx a lot jim (0 Replies)
Discussion started by: austinhell3_16
0 Replies
5. Shell Programming and Scripting
Hi Guys,
Even though, i have called db2 sql file earlier, this is my first time to call a oracle sql file.
I need to make a database(oracle) connection and then call the sql file in a loop.
Can you please help me out.
Thanks for your help and time.
Regards,
Magesh (4 Replies)
Discussion started by: mac4rfree
4 Replies
6. Solaris
Hi Solaris Experts,
The pkg utility on one of my non-global zones has stopped working, it's trying to connect to port 1008 at pkg.oracle.com
I was using pkg successfully from this zone, but now it's showing this error: lzone1 $ pkg search xterm
pkg: Some repositories failed to respond... (4 Replies)
Discussion started by: ad101
4 Replies
7. UNIX for Dummies Questions & Answers
HI Experts,
I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into
the table.
Also i... (1 Reply)
Discussion started by: sam1234
1 Replies
8. UNIX for Dummies Questions & Answers
HI Experts,
I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into
the table.
Also i... (1 Reply)
Discussion started by: sam1234
1 Replies
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
Hi,
Trying to run the Oracle Proc in parallel, but not working.. below code runs each call of the procedure and its coming out of the loop before its completion and printing the last statement! not waiting for the sqlplus to complete.
for name in `cat abc.txt`
do
(sqlplus -s ... (3 Replies)
Discussion started by: ATWC
3 Replies
LEARN ABOUT DEBIAN
sys::filesystem::unix
Sys::Filesystem::Unix(3pm) User Contributed Perl Documentation Sys::Filesystem::Unix(3pm)
NAME
Sys::Filesystem::Unix - Return generic Unix filesystem information to Sys::Filesystem
SYNOPSIS
See Sys::Filesystem.
INHERITANCE
Sys::Filesystem::Unix
ISA UNIVERSAL
METHODS
version()
Return the version of the (sub)module.
readFsTab
This method provides the capability to parse a standard unix fstab file.
It expects following arguments:
fstabPath
Full qualified path to the fstab file to read.
fstabKeys
The column names for the fstab file through an array reference.
special_fs
Hash reference containing the names of all special file systems having a true value as key.
This method return true in case the specified file could be opened for reading, false otherwise.
readMntTab
This method provides the capability to read abd parse a standard unix mount-tab file. The file is locked using flock after opening it.
It expects following arguments:
mnttabPath
Full qualified path to the mnttab file to read.
mnttabKeys
The column names for the mnttab file through an array reference.
$special_fs
Hash reference containing the names of all special file systems having a true value as key.
This method return true in case the specified file could be opened for reading and locked, false otherwise.
readMounts
This method is called to parse the information got from "mount" system command. It expects following arguments:
mount_rx
Regular expression to extract the information from each mount line.
pridx Array reference containing the index for primary keys of interest in match in following order: device, mount_point, type.
keys Array reference of the columns of the match - in order of paranteses in regular expression.
special Array reference containing the names of the special file system types.
lines Array containing the lines to parse.
readSwap
This method is called to parse the information from the swap status. It expects following arguments:
swap_rx Regular expression to extract the information from each swap status line. This regular expression should have exact one pair
of parantheses to identify the swap device.
lines Array containing the lines to parse.
VERSION
$Id: Unix.pm 128 2010-05-12 13:16:44Z trevor $
AUTHOR
Nicola Worthington <nicolaw@cpan.org> - <http://perlgirl.org.uk>
Jens Rehsack <rehsack@cpan.org> - <http://www.rehsack.de/>
COPYRIGHT
Copyright 2004,2005,2006 Nicola Worthington. Copyright 2008-2010 Jens Rehsack.
This software is licensed under The Apache Software License, Version 2.0.
<http://www.apache.org/licenses/LICENSE-2.0>
perl v5.10.1 2010-05-18 Sys::Filesystem::Unix(3pm)