Unwated data in Dim Table
Hello,
Can some one help me in the below query.
" I have dim table dim_User i am getting some useless entries in the username table like Actionid-xxxxxxxx which is causing some of the statistical issues can some once guide me to get rid of these entries by some trigger,procedure or something else"
Br,
0
Comments
Do the useless entries follow some sort of pattern? That is, do they all have that hyphen in them? If so, wouldn't a simple DELETE work?
Yes Jim the pattern is like UCA EBC - ActionId: -
If you don't want bad values to be inserted into a table column, add a "Check Constraint". For the constraint's Boolean expression, you use a Regular Expression to make sure the correct format is being used.
Below is a general example showing how to only permit valid 10-digit phone numbers with hyphens to be added to a table... I'd try to give you a better example using your pattern, but I'm not sure what the hyphens are supposed to represent
See:
https://www.vertica.com/docs/9.1.x/HTML/index.htm#Authoring/AdministratorsGuide/Constraints/ConstraintTypes/CheckConstraints.htm
https://www.vertica.com/docs/9.1.x/HTML/index.htm#Authoring/SQLReferenceManual/Functions/RegularExpressions/REGEXP_LIKE.htm