-1

How to replace SQL code that is used very often using Toad for Oracle or Oracle SQL Developer?

Dchris
  • 2,867
  • 10
  • 42
  • 73
  • more info please, example of starting point and expected results would be useful – davegreen100 Aug 10 '15 at 08:29
  • 1
    I learnt it 3 days before.. now it is on stack overflow also. There is also another way of creating through code template. Code template is also used for replacing large code. It is worked with ctrl+space. – Shravan Yadav Aug 10 '15 at 08:30
  • @davegreen100 More explanation added. Let me know if not enough. – Dchris Aug 10 '15 at 08:38

1 Answers1

0

In Toad, go to :

  1. View
  2. Toad Options
  3. Editor/Behavior
  4. Select Auto Replace
  5. Click on Add
  6. In the new line created, add the preferred key under Value column and the code to replace with under Replace With.

You can select how to trigger this shortuct by editing the **Activation expression on the same window.

enter image description here

  1. Click OK/OK and you are done!

Example: if you added the letter 's' for shortuct as in the above image, type 's' in the editor and press the Space button. Letter 's' will be replaced with "select * from".

Usually Space button is used to trigger the replacement.

{Used Toad for Oracle 11}

For Oracle SQL Developer, use below link: Auto-Replace in Oracle SQL Developer?

Dchris
  • 2,867
  • 10
  • 42
  • 73