Sponsored Content
Top Forums Shell Programming and Scripting Error for "continue" keyword in Linux script. Post 302580007 by balajesuri on Wednesday 7th of December 2011 07:23:52 AM
Old 12-07-2011
This should work, though untested:
Code:
 clean_up()
{
        db2 -x "UPDATE ${DB_SCHEMA_NAME}.ETL_DAILY SET ETL_STATUS = 'SUCCESSFUL' WHERE PROCESS_DATE = '${INT_RUN_DATE}' AND BATCH_NO = ${CM_BATCH} AND APP_ID = ${APP_ID} AND APP_VERSION = '${APP_VERSION}'" > ${TMPOUT}
        [ `grep SQLSTATE ${TMPOUT} | wc -l` -gt 0 ] && echo `date`": Failed:       ${DB_SCHEMA_NAME}.ETL_DAILY: UPDATE failed" && fclean_up "${DB_SCHEMA_NAME}.ETL_DAILY: UPDATE failed" && return 0
        echo `date`": Info:         `basename $0`: Completed Successfully !" && echo `date`": Info:         `basename $0`: Completed Successfully !" >> ${EXECUTION_LOG}
        [ -f $CM_dsload_prog_ind ] && rm $CM_dsload_prog_ind
        [ -f $DIMJOBLST ] && rm $DIMJOBLST
        [ -f $DIMJOBLST_COMMON ] && rm $DIMJOBLST_COMMON
        [ -f $DIMJOBLST_ENABLED ] && rm $DIMJOBLST_ENABLED
}

 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Syntax error near unexpected token `"Hit <ENTER> to continue:"'

the below code will search attr string inside makefile under the modelno on given path. echo "Enter model no for searching string inside makefile" read inputs2 #find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \; #;;I am getting below error.... (7 Replies)
Discussion started by: lathigara
7 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
SQLSRV_ROWS_AFFECTED(3) 												   SQLSRV_ROWS_AFFECTED(3)

sqlsrv_rows_affected - Returns the number of rows modified by the last INSERT, UPDATE, or DELETE query executed

SYNOPSIS
int sqlsrv_rows_affected (resource $stmt) DESCRIPTION
Returns the number of rows modified by the last INSERT, UPDATE, or DELETE query executed. For information about the number of rows returned by a SELECT query, see sqlsrv_num_rows(3). PARAMETERS
o $stmt - The executed statement resource for which the number of affected rows is returned. RETURN VALUES
Returns the number of rows affected by the last INSERT, UPDATE, or DELETE query. If no rows were affected, 0 is returned. If the number of affected rows cannot be determined, -1 is returned. If an error occurred, FALSE is returned. EXAMPLES
Example #1 sqlsrv_rows_affected(3) example <?php $serverName = "serverNamesqlexpress"; $connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password" ); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn === false ) { die( print_r( sqlsrv_errors(), true)); } $sql = "UPDATE Table_1 SET data = ? WHERE id = ?"; $params = array("updated data", 1); $stmt = sqlsrv_query( $conn, $sql, $params); $rows_affected = sqlsrv_rows_affected( $stmt); if( $rows_affected === false) { die( print_r( sqlsrv_errors(), true)); } elseif( $rows_affected == -1) { echo "No information available.<br />"; } else { echo $rows_affected." rows were updated.<br />"; } ?> SEE ALSO
sqlsrv_num_rows(3). PHP Documentation Group SQLSRV_ROWS_AFFECTED(3)
All times are GMT -4. The time now is 09:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy