The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's manas6 UNIX for Dummies Questions & Answers 0 06-05-2008 07:44 AM
asking about return code naamas03 Shell Programming and Scripting 3 08-28-2007 05:53 AM
Capture Oracle return code in shell script Vikas Sood Shell Programming and Scripting 1 05-22-2006 06:32 PM
Store return code of shell script in oracle table sveera Shell Programming and Scripting 3 05-04-2005 02:25 PM
Return Code of tar in AIX dupeng AIX 3 02-23-2004 12:05 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-29-2002
lesstjm lesstjm is offline
Registered User
  
 

Join Date: Nov 2001
Posts: 59
return code from oracle

I am writing a unix script that logs into oracle and does a count on a table. I want to return that count to my unix script. this is my script:

#!/bin/ksh

typeset retcode;

numin=0
sqlplus -s <<-EOSQL
myuser/mypass@mydb
variable ret_val number;
begin
select count(*) into :ret_val from ofcr_codes;
end;
exit :ret_val
EOSQL
retcode=$?
print "retcode is ${retcode}"
return 0

The retcode is coming up as zero. the retcode should equal 1100, the number of records in the ofcr_codes table. What am I doing wrong?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0