Re: Oracle + Unix question , Error validation for SQL statements
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: Oracle + Unix question , Error validation for SQL statements




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Oracle + Unix question , Error validation for SQL statements  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-20-04 10:58 PM

Ranjeesh K Ramakrishnan wrote:

> Hi,
>
> If I use co process in a shell script , what is the best way to do the
> error validation of the execution of any sql statements . I was trying
> to change the following code to make use of co process concept. When I
> tried echo $? after the execution of a "wrong statements"
> it is still giving Zero output ( meaning success)

See my response in comp.unix.questions and please make a single post
addressed to all applicable groups rather than individual posts to each
group.

-- ced

>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> cat ${CFG_DIR}/srs_indx.lst | egrep -v '^#' | egrep -v '^[    ]*$
' |
> while read x
> do
>
> ..
>
> echo " Processing values :: pre $pre tbl $tbl indx $indx tblspc
> $tblspc cols $cols param $param" >> ${LOGS_DIR}/srs_indx.log
>
> sqlplus ${BIZSTG} << EOT >> ${LOGS_DIR}/srs_indx.log
> set verify on timing on term on echo on feedback on serveroutput on
>
> WHENEVER SQLERROR CONTINUE
> drop index $indx;
>
> WHENEVER SQLERROR EXIT FAILURE
> alter session set query_rewrite_enabled = true;
> create $pre index $indx on $tbl ($cols)
> tablespace $tblspc
> $param;
> exit
> EOT
>
>
> RC=$?
> if ( test $RC -ne 0 )
> then
> 	ERR_MSG="ERROR in creating index $indx for table $tbl from
> srs_indx.ksh of $ENVIR : $APP by `whoami`@`hostname` on `date`  "
> 	echo $ERR_MSG >> ${LOGS_DIR}/srs_indx.log
> 	process_warning ${LOGS_DIR}/srs_indx.log
> 	exitstat=1
> else
> 	echo "$indx created at `date`" >> ${LOGS_DIR}/srs_indx.log
> fi
>
> done
>
>
>
>
> Any help will be appreciated .
>
> with thanks and regards
> Ranjeesh K R


--
Chuck Dillon
Senior Software Engineer
NimbleGen Systems Inc.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:22 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register