Autoreplace, some remarks

Three remarks concerning the auto replace:

1.
The AutoReplace in combination with a template file took me some time to figure out.
Problem was I needed to include the path of the template file, which was not obvious to me.

2.
When using a template file with the AutoReplace function, it seems every line is indented with one extra space. This could be annoying.

3.
When saving the AutoReplace file it shows a "File Save As..." dialog every time.
It is unneeded and a little annoying, because pressing the Save button is clear enough.
 
I cannot reproduce issue 2, though in older 7.1 versions this may have been an issue. Can you let me know your exact PL/SQL Developer version?
 
Yes, Marco, you are correct.
The second issue does not occur on the latest PL/SQL Developer version.

My apologies, I should have checked.

I do have one more idea about the templates.

Would is be possible to use a special token to move the cursor after the template insertion?

For example I could place the token in the template.
After insertion of the template this token would be removed and the cursor would be placed were the token used to be. This would be usefull.

Anyway I really like working with the PL/SQL Developer, so keep up the good work!
 
You can use a [#] for this within the template text. For example, this text:

dbms_output.put_line('[#]');

Will insert dbms_output.put_line(''); and will place the cursor between the 2 quotes.
 
Originally posted by Marco Kalter:
You can use a [#] for this within the template text. For example, this text:

dbms_output.put_line('[#]');

Will insert dbms_output.put_line(''); and will place the cursor between the 2 quotes.
Marco,
your example doesn't work with me (trial version 7.1.4.1390); can you think of a setting that can prevent it from working?
Thanks a lot, Mark
 
I have this entry in my AutoReplace file:
TO_C=TO_CHAR('[#]','DD/MM/YYYY')
When I type TO_C + TAB, the string is replaced as defined:
TO_CHAR('[#]','DD/MM/YYYY')
(I mean, even the '[#]' is typed), and the cursor places after the right parenthesis, and not instead of the '[#]'.
Same situation with the following entries:
DEC=DECODE([#])
TO_N=TO_NUMBER([#])
and your example:
DBM=DBMS_OUTPUT.PUT_LINE([#])
 
The [#] variable can only used in a template. This template can then be referenced in the AutoReplace definition. For example:

TO_C=AutoReplace\to_char.tpl

This assumes that you have created a to_char template in the AutoReplace folder.

Right-click on the AutoReplace definition to get access to the templates from the popup menu.
 
Back
Top