Page 1 of 1

How to insert spaces in a time datatype filed

PostPosted: Mon Jul 23, 2012 7:43 am
by chandra 2185
Hi,

I am inserting data into db2 table from a cobol program which reads a sequential file and loads data into db2 table. I have spaces in the data to be inserted into a time datatype column in the db2 table. so when i am trying to insert it is giving me an error. how can I handle this. your help is highly appreciated.

-Thanks.

Re: How to insert spaces in a time datatype filed

PostPosted: Mon Jul 23, 2012 8:37 am
by dick scherrer
Hello,

You will need to change the definition of the column(s) to char or ensure there is a valid date in the input data.

I suggest you correct the data so there will not be forever fiddling with a char field that should be a date.

Re: How to insert spaces in a time datatype filed

PostPosted: Mon Jul 23, 2012 12:12 pm
by GuyC
you could use NULLIF if the column is nullable.

Re: How to insert spaces in a time datatype filed

PostPosted: Mon Jul 23, 2012 12:28 pm
by NicC
Or get clarification from the writer of the program specifications as to what to do when no date/time is available or is in the wrong format.