In Teradata Is there any way to get column name as well with the error message. For example I have a table
column5 char(20)); and i try to populate this table with another table which contains some datatype mismatch
insert into test
When select tries to insert a wrong row which contains mismatch, it does not return me the COLUMNNAME.
For Example, if time is coming wrong in some field, the error message does not mention column name, it just return
6760 : invalid timestamp
but which column is having problem remains unknown.
is there is any mathod to know the columnName ?
You can't find out which field would give the Invalid Timestamp. Instead, you have to select each field and try to do the cast function.
SELECT cast(col2_dt as timestamp(0))
SELECT cast(col3_start_dt as timestamp(0))
SELECT cast(col4_end_dt as timestamp(0))
Please try to see the Datatype present in the Source Table 'test_date'. If the Datatype is a VARCHAR, then it should contain length of 26. To cast it to Timetsamp.
Yes there is a method to identify the mismatch column. It might be a slow process, but always worked for me.
You can use the following statment.
Now uncommment the column one by one and you will get the column actually causing the mismatch.