lets say i'm trying to do the following to a column that is 10 char...
DAY (DATE(ELCTDATE))
simply wanting to extract the day from the date...
what if there is blanks or invalid date data in the ELCTDATE column. Is there a way to return a 0 if so?
Guess I'm looking something syntax'd similiar to the coalesce - return literal if null - but return 0 if failed.
Oh and how I'm going about this, i am not wanting to condition anything in the where clause.
Another way to describe what I'm needing and why is...
i'm doing the following...
insert into tgtfile (target columns)
values (source columns)
many of the source columns may be wrapped in functions, like above... DAY (DATE(ELCTDATE))
so I really want to error check on each column and ignore, OR default a return value such as 0 in this case for when it fails to insert into the target column, instead of allowing the entire insert statement to abort.
DAY (DATE(ELCTDATE))
simply wanting to extract the day from the date...
what if there is blanks or invalid date data in the ELCTDATE column. Is there a way to return a 0 if so?
Guess I'm looking something syntax'd similiar to the coalesce - return literal if null - but return 0 if failed.
Oh and how I'm going about this, i am not wanting to condition anything in the where clause.
Another way to describe what I'm needing and why is...
i'm doing the following...
insert into tgtfile (target columns)
values (source columns)
many of the source columns may be wrapped in functions, like above... DAY (DATE(ELCTDATE))
so I really want to error check on each column and ignore, OR default a return value such as 0 in this case for when it fails to insert into the target column, instead of allowing the entire insert statement to abort.





Comment