A feature I have not been able to find: record or maybe define in a script a sequence of actions in a worksheet, to be "played back" later. A more specific case of this, and my main use: a named, easily invokable sequence of RegEx replacements. How would i achieve that in SQL Developer?
Scenario: I am required to migrate ASP.NET applications or simple pages with vbscript or C# as the back-end language. The back-end sourcecode contains embedded SQL, occasionally making use of bind variables, but often constructing a static SQL statement, but creating a single concatenated string with host language variables evaluated at run time. Often the SQL makes use of various methods to create a multi-line string that has to be eliminated.
I'd like to be able to copy sourcecode, paste into SQL Developer worksheet, then invoke my custom "Extract SQL from messy VB.net" macro/action/sequence to apply a sequence of RegEx replacements to the contents of the worksheet, something like:
And then i can finish it off manually.
I saw this older discussion: Re: Macro Record and Macro Play functionality is in SQL Developer
But it seemed to conclude that only keystrokes that are directly in the worksheet are included (so the quasi-dialog of the find and replace window would be excluded), and moreover, from what I can see the Macro record feature can only record one anonymous macro. So if that is all still the case, it wouldn't really fulfill the need. I could also see how a more general application actions/macro tool could handle a lot more interesting situations, but also would of course be considerably more complex to support.
An example of the source code that I would paste in::
sSQLQuery = "insert into METER_READINGS_LOG (EQUIPMENT_UID,GAUGEDATE,GAUGE,OBGRAVITY,GRAVTEMP, REC_STATUS,EDITOR,EDIT_DATE) values" & vbCrLf _
& "(" & rsMSSql.Fields("EQUIPMENT_UID").Value & "," & vbCrLf _
& "TO_DATE('" & rsMSSql.Fields("READING_DATE") & "','MM/DD/YYYY HH:MI:SS AM'), " & vbCrLf _
& rsMSSql.Fields("LVL") & "," & vbCrLf _
& rsMSSql.Fields("OBSV_GRAVITY") & "," & vbCrLf _
& rsMSSql.Fields("TEMPERATURE") & "," & vbCrLf _
& " 'T', 'TAF_SCADA', " & vbCrLf _
& "TO_DATE('" & date() & " " & time() & "','MM/DD/YYYY HH:MI:SS AM') )" & vbCrLf