Hi Team,
I am trying to add timestamp to SQLs by taking the timestamp in variable through shell script.I started like this.
when i try to execute the above connect to database is working but at the T line its giving error .
"
T=SQL1024N A database connection does not exist. SQLSTATE=08003
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL1024N A database connection does not exist. SQLSTATE=08003"
Can some body suggest how to add timestamp after cat <<EOF > to a variable using db2 commands or using linux comands?
Regards
valid Command Line Processor command. During SQL processing it returned:
SQL1024N A database connection does not exist. SQLSTATE=08003
Yes ,That is related to db2 but does the sytnax prompting to give this error ?
did that timestamp syntax looks ok do i need to change some thing ? Even the before connect statement connected.Is this correct ?
CUR_TIME=`db2 -x "select CURRENT_TIMESTAMP from sysibm.sysdummy1 "`;
No. The "T=" line has become part of the SQL program ... and failed a SQL syntax check.
Also, there is no trailing "EOF" line in your script to terminate the Here Document.
The Shell "T=" line needs to be before or after the Here Document depending on whether you want to use the start time or the end time. You could of course use the unix "date" commmand to get the current date and time in any format you desire (but still outside of the Here Document).
Hi,
i have a raw output file like this
167,63.50
167,63.50
168,63.68
166,63.68
168,63.68
I would like to add every each N rows (for example 60) and in a third column , a timestamp using the command date +"%H:%M"how can i do it with one single command ?
Thank you !! (5 Replies)
when I try to read a file and send email using cat and sendmail: The email received having additional spaces.(Between the letters of words in the text)
My code:
export MAILTO="sa@y.com"
export SUBJECT="mydomain PREPROD MONITOR AT ${DATE}"
export... (5 Replies)
Hi allI am mailing csv file to our lotusnote server using shell script. I am using command to get require date/time :date +"%d%b%y-%X%p"File name is :TESTFILE-29Jan14-09:00:00AM.csv.When I am receving this on lotusnote server coming as "00AM.csv" rest of the string is getting truncated. I feel due... (1 Reply)
There are files in a directory and I have to move multiple files adding datetimestamp before the file type.
/Data/
abc.csv
def.csv
ghi.csv
I have to move this files to archive directory adding datatimestamp before .csv
/archive/
abc_YYYYMMDDHHMMSS.csv
def_YYYYMMDDHHMMSS.csv... (7 Replies)
hey guys, i'm having a bit of trouble with my script. based on the time you started a shift for work, it's supposed to read the input, and then parse a log file of alerts accordingly. my issue is parsing out from the time entered as your start time until the end of the file. the format looks like... (6 Replies)
Hello attempting to redirect out to create a startup script in solaris. The steps are working but the $1 entry is being left out. syntax below and content of output file below.
cat > S99build << EOF
> #!/bin/bash
> case $1 in
> 'start')
> /usr/os-buildsol.sh
>
> ;;
> esac
> exit 0
>... (3 Replies)