timestamp field was padded with blanks warning


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting timestamp field was padded with blanks warning
# 1  
Old 04-15-2011
timestamp field was padded with blanks warning

There are two columns on the data base table, create and update timestamps of datatype timestamp.

I dont have these fields on the csv file. So I am doing the below.

awk -F , -v d="$(date "+ %Y-%m-%d-%H.%M.%S")" '{ OFS=FS; print $1, $2, $3, $4, d, $5, $6, d }' temp.csv > temp1.csv

and then I insert the data to the table. Its inserting the data fine to the table.

But it throws the below warning for each row its inserting when I run the script.

How do I get rid of this warning ?

SQL3129W The date, time, or timestamp field containing "2011-04-14-16.22.39"
in row "1" and column "8" was padded with blanks.

Thank you in advance.
# 2  
Old 04-15-2011
which database are u using? sql can be various depends on different database.

and have you tried this format?

'2011-04-14 22:22:22.2'
# 3  
Old 04-15-2011
This is a database issue, not a shell script one.

In any event, my suggestion is to replace the '-' with space between the date and the time:
Code:
"2011-04-14 16.22.39"

# 4  
Old 04-15-2011
actually I initially tried with space ..but then it would throw this message
and also it would not insert the row to the table..

SQL3148W A row from the input file was not inserted into the table. SQLCODE
"-180" was returned.

SQL0180N The syntax of the string representation of a datetime value is
incorrect. SQLSTATE=22007
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Printf padded string

Is possible to print padded string in printf? Example echo 1 | awk '{printf("%03d\n", $1)}' 001I want S1 S11 S2 S21to be padded as: S01 S11 S02 S21Thanks! (26 Replies)
Discussion started by: yifangt
26 Replies

2. Shell Programming and Scripting

Comma padded.. Output

Hello, here is the outout of the command below.. Can someone please tell me how to get the output as below output needed: 18914,30716,17051,4139,14155... ( no comma for the last value) ps -e -o pcpu,pid,user,tty,args | sort -n -k 1 -r | head | awk '{print $2}' 18914 30716 17051 4139... (10 Replies)
Discussion started by: kamathg
10 Replies

3. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies

4. Shell Programming and Scripting

Check if a date field has date or timestamp or date&timestamp

Hi, In a field, I should receive the date with time stamp in a particular field. But sometimes the vendor sends just the date or the timestamp or correctl the date&timestamp. I have to figure out the the data is a date or time stamp or date&timestamp. If it is date then append "<space>00:00:00"... (1 Reply)
Discussion started by: machomaddy
1 Replies

5. Shell Programming and Scripting

Delimted to padded conversion with unknown field length

I’m looking for an elegant way to convert a delimited file (comma delimited in this case) to padded columns (for printing in non-proportional font) but the length of each column is not known ahead of time. It needs to be calculated for each column from the longest entry in that column in a given... (3 Replies)
Discussion started by: Michael Stora
3 Replies

6. Shell Programming and Scripting

Using Seq As A Variable With Padded Digits

Hi all. Im trying to use a sequence in a while loop like this below. I need it for navigating a year, month, day folder structure where a user can input the start date and have it go to the desired end date. The script will grab a certain file on each day then move onto the next. Ive got all that... (3 Replies)
Discussion started by: Grizzly
3 Replies

7. UNIX for Dummies Questions & Answers

How to left trim padded zeroes

I have a filename 'INITIATE_FINAL_ALL_000080889.dat', and I want to capture just the number '80889' from it. Here is what I have so far: %> echo INITIATE_FINAL_ALL_000080889.dat | sed "s/*//g" 000080889 Now, I just need to trim off the padded zeroes. Thanks, - CB (3 Replies)
Discussion started by: ChicagoBlues
3 Replies

8. Filesystems, Disks and Memory

finding empty files that are padded with zeros

how can search for files that are non-zero length but are empty? (1 Reply)
Discussion started by: polive96
1 Replies

9. Shell Programming and Scripting

Move and rename files in seq. with padded digits

Greetings, I am new to scripting, but find if I can see the code working for a given problem, then I can eventually figure it out. (9 Replies)
Discussion started by: rocinante
9 Replies

10. Shell Programming and Scripting

Problem with echo for var, padded with spaces

While concatenating 2 values, one which expanded to fixed width & other not, I am not getting value expanded as fixed width. Following is script for the same : #!/bin/sh var1="abc" var2="def" var1Fxd=`echo $var1 | awk '{printf("%-6s",$0)}'` echo $var1Fxd""$var2 But, if I try - echo... (2 Replies)
Discussion started by: videsh77
2 Replies
Login or Register to Ask a Question