Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to Make Sql Plus Exit with an Error Code Post 302532442 by Peasant on Tuesday 21st of June 2011 02:48:47 AM
Old 06-21-2011
Please check if this will be useful to you.
Code:
variable exitcode number;
begin
select 23 into :exitcode from dual;
end;
/
exit :exitcode

When running sql above from cli, $? from sqlplus will be 23 in this case.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sql error code trapping

Hello #!bin/ksh sqlplus -s system/manager < |grep '^ORA' |uniq select * from kk; set echo on show spool on end; / EOF save test.sh sh test.sh results ORA-00942: table or view does not exist (3 Replies)
Discussion started by: xiamin
3 Replies

2. Shell Programming and Scripting

All about exit code

Hi, I am working on Solaris 8 and the "intro" man page says, "Upon termination, each command returns two bytes of status, one supplied by the system and given the cause for termination, and (in the case of 'normal' termination) one supplied by the program. The former byte is 0 for normal... (2 Replies)
Discussion started by: cdin2
2 Replies

3. UNIX for Dummies Questions & Answers

Where can I find a list of exit codes? (Exit code 64)

I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
Discussion started by: jkuchar747
3 Replies

4. Linux

Error in issuing a make and make install

Hi, Recently I install a package and try to do a make and make install. However, in the make it gives me below error:- make:Nothing to be done for 'install-exec-am' make:Nothing to be done for 'install-data-am' Can anyone please explain to me what does this mean? I have been trying... (1 Reply)
Discussion started by: ahjiefreak
1 Replies

5. Shell Programming and Scripting

top's exit code indicates error--is this a bug?

This single line of code in a sh script file top -b -n 1 -U $USER causes the script to prematurely exit with an exit code of 1 (i.e. an error) if the script is run with the -e option (e.g. if set -e is executed near the top of the script file). Alternatively, you can execute it like top... (8 Replies)
Discussion started by: fabulous2
8 Replies

6. Solaris

Gani Network Driver Won't Install - make: Fatal error: Don't know how to make targ...

I attached a README file that I will refer to. I successfully completed everything in the README file until step 4. # pwd /gani/gani-2.4.4 # ls COPYING Makefile.macros gem.c Makefile Makefile.sparc_gcc gem.h Makefile.amd64_gcc ... (1 Reply)
Discussion started by: Bradj47
1 Replies

7. Shell Programming and Scripting

How to grep sql error in shell script and exit the script?

I need help in the following script. I want to grep the sql errors insert into the error table and exit the shell script if there is any error, otherwise keep running the scripts. Here is my script #!/bin/csh -f source .orapass set user = $USER set pass = $PASS cd /opt/data/scripts echo... (2 Replies)
Discussion started by: allinshell99
2 Replies

8. Shell Programming and Scripting

Make expect exit the UNIX script in erreneous condition

Hi, I am writing a menu driven program using shell script. THe script will be collecting data by logging into the other servers and bringing back the data to home server to process it and accordingly issue commands. TO automate commands execution , I am using expect script. However I am not able... (5 Replies)
Discussion started by: ashima jain
5 Replies

9. UNIX for Advanced & Expert Users

Exit when sql script give error

Hi Guys, I am calling a SQL script which runs under while loop, i need to exit the while loop if i get error in sql script which is called while do sqlplus -s user/pass@db @test.sql id$i done test.sql whenever sqlerror exit; alter table t1 add &1 number; I need to come out of... (2 Replies)
Discussion started by: rohit_shinez
2 Replies

10. Shell Programming and Scripting

Function - Make your function return an exit status

Hi All, Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition. #Body function1() { if then echo "exist" else echo "not exist" } #if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
HTTPING(1)						      General Commands Manual							HTTPING(1)

NAME
httping - measure the lateceny and throughput of a webserver SYNOPSIS
httping [options] options: [-g url] [-h hostname] [-p portnumber] [-x proxyhost:port] [-c count] [-i interval] [-t timeout] [-s] [-G] [-b] [-L xferlimit] [-X] [-l] [-z] [-f] [-m] [-o rc,...] [-e string] [-I useragent string] [-R referer string] [-r] [-n warn,crit] [-N mode] [-q] [-V] DESCRIPTION
The program httping lets you measure the latency of a webserver. Since version 1.0.6 also the throughput can be measured. OPTIONS
-g url This selects the url to probe. E.g.: http://localhost/ -h hostname Instead of '-g' one can also set a hostname to probe with -h: -h localhost -p portnumber -p can be used together with -h. -p selects the portnumber to probe. -x proxyhost:port] Probe using a proxyserver. Note that you're also measuring the latency of the proxyserver! -c count How many probes to send before exiting. -i interval How many seconds to sleep between every probe sent. -t timeout How long to wait for answer from the other side. -S Split measured latency in time to connect and time to exchange a request with the HTTP server. -s When a successfull transaction was done, show the HTTP statuscode (200, 404, etc.). -G Do a GET request instead of a HEAD request: this means that also the complete page/file must be transferred. Note that in this case you're no longer measuring the latency! -b Use this switch together with '-G'. When this option is used, the transferspeed (in KB/s) is shown. -B Use this switch together with '-G'. Ask the HTTP server to compress the returned data: this will reduce the influence of the band- width of your connection while increasing the influence of the processorpower of the HTTP server. -L x Use this switch together with '-G'. Limit the amount of data transferred to 'x'. Note that this only affects the content of the page/file and not the headerdata. -X Use this switch together with '-G'. For each "ping" show the amount of data transferred (excluding the headers). -l Connect using SSL: for this to work you need to give a 'https'-url or a 443 portnumber. -z When connecting using SSL, display the fingerprint of the X509 certificate(s) of the peer. -a Audible ping -f Flood ping: do not sit idle between each ping but ping as fast as the computer and network allow you to. -m Show machine readable output (also check '-o' and '-e'). -o x,x,... This selects the HTTP status-codes which are regarded as an OK-state. -e str When the status-code differs from the ones selected with '-o', the given string is displayed. -I str UserAgent-string to send to the webserver (instead of 'HTTPing <version>'). -R str Referer-string to send to the webserver. -r Only resolve the hostname once: this takes the resolving out of the loop so that the latency of the DNS is not measured. Also use- full when you want to measure only 1 webserver while the DNS returns a different ip-address for each resolve ('roundrobin'). -n warn,crit Switches HTTPing to Nagios-plugin mode 1: return exitcode '1' when the average response time is bigger then 'warn', return exitcode '2' when the the average response time is bigger then 'crit'. In all other cases return exitcode '0'. -N x Switches HTTPing to Nagios-plugin mode 2: return 0 when everything is fine, 'x' when anything fails. E.g.: 1 => Nagios warning state, 2 => Nagios critical state. -q Be quiet, only return an exit-code. -A,U,P Activate the basic authentication, Username follow the -U, Password the -P. -V Show the version and exit. KEYS
Press <CTRL> + <c> to exit the program. It will display a summary of what was measured. EXAMPLES
httping -g http://localhost/ Ping the webserver on host 'localhost'. httping -h localhost -p 1000 Ping the webserver on host 'localhost' and portnumber 1000. httping -l -g https://localhost/ Ping the webserver on host 'localhost' using an SSL connection. httping -g http://localhost/ -A -U username -P password Ping the webserver on host 'localhost' using the Basic HTTP Authentication. BUGS
None. This program is totally bug-free. SEE ALSO
http://www.vanheusden.com/httping/ NOTES
This page describes httping as found in the httping-1.0.8 package; other versions may differ slightly. Please mail corrections and addi- tions to folkert@vanheusden.com. Report bugs in the program to folkert@vanheusden.com. Consider using PGP. My PGP key-id is: 0x1f28d8ae httping 2005-11 HTTPING(1)
All times are GMT -4. The time now is 07:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy