Auto Replace in Rapid SQL by Dan Hotka

by Oct 8, 2014

Hi!

Dan Hotka here with more knowledge about Rapid SQL. I’ll address the auto replace feature of this tool and how you can use this feature to create customized shortcuts that should benefit your coding projects and style.

The auto replace feature of Rapid SQL has some useful examples already in it. You will certainly want to add a bunch of your own!

Auto replace is triggered by the space bar. Rapid SQL will check any word entered against this list and substitute in the replaced option.

Hide image

At line 14, I entered ‘cou’ then hit the space bar.

Hide image

Notice the ‘select count(*) from ‘ then appeared.

This technique is easily manipulated for your benefit and coding style.

Hide image
Click to see full-sized image

To make sure this feature is both turned on and available…click on Tools à Code Workbench then make sure the Settings tab has Auto Replace enabled.

Hide image

Notice that you can export and import your settings between releases of Rapid SQL. This is convenient to preserve your short cuts and code templates. We will cover the code templates in the next blog.

Hide image

Now click on the Auto Replace tab and you will see the existing short cuts. Notice there are several for DBMS_OUTPUT.

I want to add a couple. I can add anything I usually typo. I want to add a short cut for DBMS_OUTPUT.Put_Line(“ .

Hide image

To do this, click the ‘Add’ button…and fill out the box. ‘\s’ is the space bar for Activation.

Lets test the new Auto Replace Expression:

Hide image

I enter the ‘pl’ short cut and voila!

Hide image

My auto replace entry works! I intentionally left the rest of the line off as I would start my coding at the double quote. Notice Rapid SQL turned the rest of my code red because of the lack of an ending on this line. Rapid SQL is reminding us that there is a syntax error until we complete our code here.

I find this technique quite useful. You can use it to add any single line short cut you desire. You can export and save these shortcuts if you get a new computer. I have a series of my own short cuts I enjoy and will take 5 minutes and adjust the tool to accommodate the coding technique that I have grown accustomed to over the years.

I hope this technique helps you in your day-to-day use of Rapid SQL.

Dan Hotka

Oracle ACE Director

Instructor/Author/CEO

Click to learn more about Embarcadero database tools related to this post:


Hide image

Dan Hotka is a training Specialist and an Oracle ACE Director who has over 36 years in the computer industry, and over 30 years of experience with Oracle products. His experience with the Oracle RDBMS dates back to the Oracle V4.0 days. Dan enjoys sharing his knowledge of the Oracle RDBMS. Dan is well-published with12 Oracle books and well over 200 published articles. He is frequently published in Oracle trade journals, regularly blogs, and speaks at Oracle conferences and user groups around the world.