Drag/Drop Templates

dgs!

Member³
I make extensive use of templates to store cool things I use every day.
I am sometimes unable to simply drag/drop templates because developer request user input (where none should be expected).

In this example I am trying to extract the center portion of a table name (aaa_bbb_ccc), I just want to see the 'bbb'

If a template contains the line below, I am prompted for user input and if I do not provide any, the functioning portion of the statement is omitted.
SELECT regexp_substr('aaa_bbb_ccc', '[^ _]+', 1, 2) table_abbrev from dual;

Can we make the request for user input be & or &&?
 
To escape variable substitution in a template you can use && instead of & for the new 11.0 syntax and [[ instead of [ for the old syntax.
 
I'm trying to leave the statement AS-IS, no additional characters.
If I select 'Modify' and cut/paste the text of the template into a SQL window, it works great.

I'd like to have the ability to drag/drop this template text into a SQL window without being prompted for input.
Can you give me an example of what would need to be added to this statement to prevent being prompted for input?

SELECT regexp_substr('aaa_bbb_ccc', '[^ _]+', 1, 2) table_abbrev from dual;
 
Just replace [ by [[ as follows:

SELECT regexp_substr('aaa_bbb_ccc', '[[^ _]+', 1, 2) table_abbrev from dual;
 
Back
Top