Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL*Plus errors... how to hide?

RE: SQL*Plus errors... how to hide?

From: <Stephen.Lee_at_DTAG.Com>
Date: Thu, 06 Nov 2003 15:14:25 -0800
Message-ID: <F001.005D5DDC.20031106151425@fatcity.com>

If the data is supposed to be strictly numeric, you can intercept the bad data prior to running the sql.

X=''
while [ -z "$X" ]; do

	echo ""
	echo "Enter a number or Q to quit"
	read X
	if [ "$X" = "Q" ]; then
		echo "Exiting ..."
		exit 0
	fi
	if [ -z "$X" ]; then
		echo ""
		echo "That was a blank entry. Try again."
		echo ""
		continue
	fi
	if  [ -n "`echo $X | sed -n '/[^0-9]/p'`" ]; then
		echo ""
		echo "You entered at least one non-numeric character."
		echo "You entered ->${X}<-"
		echo "Try again."
		echo ""
		X=""
		continue
	fi

done

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: <Stephen.Lee_at_DTAG.Com
  INET: Stephen.Lee_at_DTAG.Com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Nov 06 2003 - 17:14:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US