Last active
February 3, 2025 07:37
-
-
Save Jonathan-49/831c4ee26322af48e2bc06d857b15ca0 to your computer and use it in GitHub Desktop.
IBM i Db2 Check for digits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Will return 0 if the string contains only digits | |
-- or the number of characters found. | |
-- OS: IBM i Db2 | |
Create or replace Function isNumeric ( | |
V_INPUT VarChar(1000)) | |
Returns INT | |
Language SQL | |
Deterministic | |
Reads SQL Data | |
Called on NULL Input | |
Disallow Parallel | |
Return | |
length(replace(trim(translate(V_INPUT, ' ', | |
'1234567890' )), ' ', '')); | |
End; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment