05-29-2003
Return code from PL/SQL Code
Hi Guys,
I was just wondering if anybody can help me with this problem.
OK, how we can get a value back from PL/SQL Script (not stored procedure/function)
See the below example: (for example aaa.sh)
#!/bin/ksh
VALUE=`sqlplus -s user/password@test_id <<EOF
@xxx.sq
EOF`
echo $VALUE
And xxx.sql is like below:
DECLARE
x number = 10;
y number = 0;
BEGIN
y = x /2;
END;
/
exit
OK, I'd like to get the value of "y" variable from xxx.sql back into the calling aaa.sh VALUE variable...
Mind you "exit y;" doesn't help...
Thanks in advance.
l
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
two programs A and B writting in c++
I am using A to B and I want to know the return code of B.
in B
------------------------
int main()
{
return 11;
}
------------------------
in A
------------------------
int main()
{
system(A);
}
------------------------
Is it the right way... (1 Reply)
Discussion started by: filedeliver
1 Replies
2. Shell Programming and Scripting
hi all
my system is linux red hat
i have a script that runs some object .
the object return some code to the system
i see the code by writing echo $?
i want to ask in the script if $? equals 14
how shell is do that in the script
thanks (3 Replies)
Discussion started by: naamas03
3 Replies
3. Shell Programming and Scripting
hey all,
I have a simple script
#!/bin/bash
./cron.sh test_a.txt &
./cron.sh test_b.txt &
wait
I want to invoke another program based on the return status of the above calls. How am I were to get that? Thanks! (2 Replies)
Discussion started by: mpang_
2 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
5. Shell Programming and Scripting
Hi Guys,,
I am having a unix script which is running the DB2 Insert command.
For the insert command, there were no records to be updated.
SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a
query is an empty table. SQLSTATE=02000
+ + echo 1
STAGE_RC=1
+ ]
... (6 Replies)
Discussion started by: mac4rfree
6 Replies
6. Shell Programming and Scripting
Hello folks,
I have a question that if i type ls command and type echo $? it always show "0", how i could do this change that when i type ls it will show me 1, actually i want to change the return code of commands from 0 to 1.
Thanks
Bash (5 Replies)
Discussion started by: learnbash
5 Replies
7. Shell Programming and Scripting
Hi guys,
I am quite new in shell scripting.
I am tring to promote some oracle jobs into control-M. In control-M, I am calling a script which establishes a connection with database and execute some procedures. Now I want if that PL/sql Block got failed script should return failure to... (2 Replies)
Discussion started by: alok1301
2 Replies
8. UNIX for Advanced & Expert Users
Hi Experts:
I have a shell script that's kicked off by cron. Inside this shell script, I need to kick off two or more oracle sql scripts to process different groups of tables. And when both sql scripts are done, I will continue in the shell script to do other things like checking processing... (3 Replies)
Discussion started by: huasheng8
3 Replies
9. Shell Programming and Scripting
Hello,
I am woring on a script where I am getting strange situation.This script actually fetch the source code and tar that code and send to NAS location.This code resides in MKS tool...and we are fetching the source code on checkpoint label basis and script is working fine.First it synch the... (0 Replies)
Discussion started by: anuragpgtgerman
0 Replies
10. UNIX for Beginners Questions & Answers
Hello everyone
Can some help me with understand return code in expect
#!/usr/bin/expect
set timeout 1
set SRV
set user
set pw
spawn ssh $user@$SRV
expect {
"(yes/no)? " { send "yes\r" ; exp_continue }
"assword: " { send "$pw\r" ; exp_continue }
eof
}... (2 Replies)
Discussion started by: vikus
2 Replies
LEARN ABOUT DEBIAN
sql::statement::term
SQL::Statement::Term(3pm) User Contributed Perl Documentation SQL::Statement::Term(3pm)
NAME
SQL::Statement::Term - base class for all terms
SYNOPSIS
# create a term with an SQL::Statement object as owner
my $term = SQL::Statement::Term->new( $owner );
# access the value of that term
$term->value( $eval );
DESCRIPTION
SQL::Statement::Term is an abstract base class providing the interface for all terms.
INHERITANCE
SQL::Statement::Term
METHODS
new
Instantiates new term and stores a weak reference to the owner.
value
Abstract method which will return the value of the term. Must be overridden by derived classes.
DESTROY
Destroys the term and undefines the weak reference to the owner.
NAME
SQL::Statement::ConstantTerm - term for constant values
SYNOPSIS
# create a term with an SQL::Statement object as owner
my $term = SQL::Statement::ConstantTerm->new( $owner, 'foo' );
# access the value of that term - returns 'foo'
$term->value( $eval );
DESCRIPTION
SQL::Statement::ConstantTerm implements a term which will always return the same constant value.
INHERITANCE
SQL::Statement::ConstantTerm
ISA SQL::Statement::Term
METHODS
new
Instantiates new term and stores the constant to deliver and a weak reference to the owner.
value
Returns the specified constant.
NAME
SQL::Statement::ColumnValue - term for column values
SYNOPSIS
# create a term with an SQL::Statement object as owner
my $term = SQL::Statement::ColumnValue->new( $owner, 'id' );
# access the value of that term - returns the value of the column 'id'
# of the currently active row in $eval
$term->value( $eval );
DESCRIPTION
SQL::Statement::ColumnValue implements a term which will return the specified column of the active row.
INHERITANCE
SQL::Statement::ColumnValue
ISA SQL::Statement::Term
METHODS
new
Instantiates new term and stores the column name to deliver and a weak reference to the owner.
value
Returns the specified column value.
AUTHOR AND COPYRIGHT
Copyright (c) 2009,2010 by Jens Rehsack: rehsackATcpan.org
All rights reserved.
You may distribute this module under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl
README file.
perl v5.10.1 2011-02-01 SQL::Statement::Term(3pm)