![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| How is use sselect statement o/p in insert statement. | nkosaraju | Shell Programming and Scripting | 2 | 08-06-2008 09:26 PM |
| (sed) parsing insert statement column that crosses multiple lines | jjordan | Shell Programming and Scripting | 3 | 10-09-2007 12:23 AM |
| Script does not execute Insert Statement | Amruta Pitkar | Shell Programming and Scripting | 4 | 08-24-2006 11:14 PM |
| Insert TAB in echo statement | sunils27 | Shell Programming and Scripting | 5 | 08-26-2005 03:36 AM |
| awk command for INSERT statement | nattynatty | Shell Programming and Scripting | 4 | 05-10-2002 02:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
error in insert statement
hi,
When i try to run the code below, i get the following error "ksh: syntax error: `(' unexpected" i am not able to figure it out. Can anyone help me? Code: Quote:
|
|
||||
|
try this
Code:
ERROR_CD=$1
PARAM_PASSED=$#
CUR_YEAR=`date | awk '{print$6}'`
CUR_MONTH=`date +%m`
CUR_DAY=`date +%d`
CUR_TIME=`date | awk '{print$4}' | sed -e 's/:/./g'`
TODAY_DATE=`echo $CUR_YEAR-$CUR_MONTH-$CUR_DAY-$CUR_TIME.00`
if [ $PARAM_PASSED = 1 ]; then
if [ $ERROR_CD = 01 ]; then
db2 connect to databasename user <username> using <password>
db2 "insert into <tablename> (col1,col2,col3,col4,col5,col6) values('$TODAY_DATE','$ERROR_CD','Val1','Val2','VAl3','Val4');"
terminate
elif [ $ERROR_CD = 02 ]; then
db2 connect to databasename user <username> using <password>
db2 "insert into <tablename> (col1,col2,col3,col4,col5,col6) values('$TODAY_DATE','$ERROR_CD','Val1','Val2','VAl3','Val4');"
terminate
elif [ $ERROR_CD = 03 ]; then
db2 connect to databasename user <username> using <password>
db2 "insert into <tablename> (col1,col2,col3,col4,col5,col6) values('$TODAY_DATE','$ERROR_CD','Val1','Val2','VAl3','Val4');"
terminate
fi
else
exit
fi
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|