Improve company productivity with a Business Account.Sign Up
WHERE LENGTH(RTRIM(TRANSLATE(PHONE_NBR, '*', ' 0123456789'))) = 0
Open in new window
ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.
One of a set of tools we're offering as a way to say thank you for being a part of the community.
CREATE FUNCTION IntegerPart (
modifies sql data
set option dbgview = *source
-- Scratch variables used for processing
DECLARE outputString VARCHAR(100);
DECLARE stringLength INT;
DECLARE loopCounter INT;
DECLARE charAtPos VARCHAR(1);
-- If the incoming string is NULL, return NULL
IF (inString IS NULL) THEN
-- Initialize the scratch variables
SET outputString = '';
SET stringLength = LENGTH(inString);
SET loopCounter = 1;
-- Loop over the string
WHILE (loopCounter <= stringLength) DO
-- Get the single character off the string
SET charAtPos = SUBSTRING (inString, loopCounter, 1);
-- If the character is numeric, add it to the result
IF ((CharAtPos >= '0') and (CharAtPos <= '9')) then
SET outputString = outputString || charAtPos;
SET loopCounter = loopCounter + 1;
-- Return the final output
if (outputString = '') then
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.