when calling to_number() or to_timestamp() function and something goes wrong an exception is thrown.
Is there a possiblity to return null instead of throwing an error? Like safe casting via
I thought maybe to write custom functions and catch those errors, but it cannot be done via CREATE FUNCTION (SQL Functions).Could it be done via native functions in C? Create wrapping functions which call for example to_number() and if errors are throws to return null?
Code: Select all
Or maybe another approach?