Yesterday was regular expression day. I got asked by three different people about regex search options in SQL Developer. One of those wanted to know how to use them in the Data Modeler.
Scenario: Find all columns which have precision of 9 or less
I know, silly scenario. But I’m not that great with regular expressions, and I needed an easy one to play with.
So this expression [0-9] will match any text that looks like 0 or 1 or 2 or 3 or … 9. Basically, any 1 digit numbers.
I don’t know how to do a search in the modeler to say that data type precision is < 10, so the regular expression works nicely. Regular expression searches are supported in both simple and advanced modes. Now, since I'm searching a specific table element, I'm going to go with advanced. [caption id="attachment_4651" align="aligncenter" width="1000"] Just toggle on the RegEx search flag and you’re good to go[/caption]
Hit ‘Find’ and voila:
It’s not JUST search my friends 🙂
- Turn the search results into a report
- Change the properties for all of the search results
- Navigate to said diagram object
So for example, I can hit the properties button, and change in one swoop every single digit precision defined column to having a precision of 10.
If the properties are common across all of the search result objects, you’ll see the value in the OLD VALUE box. But even if they’re NOT common, you can still change them. I changed them to 10, and hit the dialog box again.
I can see they’re now all 10 and I can change them to 15 if I want. Of course you’re versioning your designs and you can undo these changes at any time, right?
1 Comment
Do you plan to implement case switching for replacement patterns like in R?
http://www.regular-expressions.info/replacecase.html
If HeLlO WoRlD is given, the replacement text \U$1 \L$2 becomes HELLO world. Literal text is not affected. \U$1 Dear $2 becomes HELLO Dear WORLD.