Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 05:08 AM
Hello @biafch,
The error you are encountering is due to the DBR 11.3 enforcing stricter type casting rules under ANSI mode. Specifically, the error message indicates that there is an attempt to cast a timestamp to a boolean, which is not allowed.
Here are a few steps you can take to resolve this issue:
- Identify the Source of the Cast: Review your code and the schema of the tables involved to identify where the timestamp might be incorrectly cast to a boolean. This could be happening implicitly in your SQL statements or transformations.
- Check for Implicit Casts: Ensure that there are no implicit casts happening in your SQL statements. For example, if you have any expressions that might be causing the timestamp to be interpreted as a boolean, you need to correct them.
- Review Data Types: Verify the data types of the columns in your source and target tables. Ensure that the data types are consistent and that no timestamp columns are being used in a context where a boolean is expected.
- Use try_cast: If you need to handle malformed data gracefully, consider using try_cast instead of CAST. This function will return NULL for invalid casts instead of throwing an error.
Here is an example of how you might modify your SQL statement to use try_cast:
SELECT try_cast(RawDataStartDate AS BOOLEAN) AS RawDataStartDateBoolean
FROM v_staging_silverInsert_{0}_{1}