Code searching isn’t new for version 4.2. It’s not even new for version 4.1, or v4.0…but what IS new, is that some folks consider the SQL behind their VIEW objects to be ‘code.’
So, for version 4.2, you can say, search my PL/SQL source AND search the SQL behind my views.
You’ll notice there’s an option to add wildcards around your search term for the ‘Code’ category – that’s useful when searching object names in your data dictionary and also for references to that object in your source code.
Hit ‘Go’, and voila.
It’s not exactly easy to search on views, the code behind a view is stored in a LONG column. But, it’s not impossible.
You can see how we do it by using the Statements panel.
Don’t forget the ‘Trick!’
My favorite way to access the search.
14 Comments
Hi,
I want to search for any code that contains a certain expression. Code in a Scheduler-Program which is included in “program_action” (line 4) isn’t found.
Are there certain exceptions of code that is excluded from the search even if the code checkbox is selected and ORDS is un-selected?
I doubt the scheduler definitions are included in the search, if you look at the SQL ran, you can see what’s covered and not (view – log – statements panel)
Hi,
Is there any shortcut to view source behind any Function/Procedure/Package etc. without browsing through the objects for example in TOAD, simply write object name in the editor and by pressing F4 will display the source text.
Of course, try this. Ctrl+click is what I’m referring to.
Thx a lot, yes it works fine but surprisingly Ctrl+Click doesn’t work if previous statement in the editor
doesn’t contain a semicolon (;) unless this is the only statement in the editor e.g. consider the below 2 stmts
1. select * from AAA
2. select * from BBB
No issue with table AAA but Ctrl+Click wouldn’t work on table BBB unless put a ; after sttm 1
Both Ctrl+Click and Shift+F4 doesn’t work if the object in single quotes
But still this is manageable, thx for the quick tips.
select * from dba_objects where lower(object_name) = ‘abc’
Sadly, I just discovered it doesn’t seem to search materialised view source (all_mviews) . I am still on 4.2
Yeah, but we should easily be able to add this. I’ll try for version 17.3.
Can you try again for version 19.1? Still not there as of 18.4
I have SQL developer 17.2, in the “Code” section there is a new option labeled “ORDS”. I don’t know what this is, but if it’s selected my searches never return any results.
Yeah, it’s a known bug. Just uncheck it and you should be fine.
A great feature I had not noticed with the EAs. Seems pretty fast,too. Thanks!
Yeah, we added it after the last EA was published. People ask, people get 🙂
Shortcut Alt+G is not available in Mac version of Sql Developer 4.2 , and I cannot configure it because there is no entry “Find DB Object” in “Preference” / “Shortcut Keys” configuration page.
Yeah, it’s Windows only. And yeah, I consider that a bug.