whip
Member²
Hi all,
I put together a test script which can generate
a SQL script which in turn selects:
- a comma separated list of values
- insert statements
- a lot of other things
based on
- an object name (table, view, synonym etc.)
- an arbitrary SQL query.
What it generates is determined by the templates in the script parameters. It can handle numbers, dates and (most?) character types. The generated query escapes apostrophes in strings and can also escape CHR(10) characters if you want (see also the topic: Sessions window grid copy changed).
A known bug:
If you generate a comma separated list (see the example included), the first line will begin with a comma.
How to use it:
- Save this script to a file.
- Open the script in a Test window.
- Change any parameters according to your needs.
- Run the script.
- Click on the '...' icon to the right of the result_set parameter.
- Copy the results.
The script is included as a new message below.
Any feedback is appreciated.
Tom
I put together a test script which can generate
a SQL script which in turn selects:
- a comma separated list of values
- insert statements
- a lot of other things
based on
- an object name (table, view, synonym etc.)
- an arbitrary SQL query.
What it generates is determined by the templates in the script parameters. It can handle numbers, dates and (most?) character types. The generated query escapes apostrophes in strings and can also escape CHR(10) characters if you want (see also the topic: Sessions window grid copy changed).
A known bug:
If you generate a comma separated list (see the example included), the first line will begin with a comma.
How to use it:
- Save this script to a file.
- Open the script in a Test window.
- Change any parameters according to your needs.
- Run the script.
- Click on the '...' icon to the right of the result_set parameter.
- Copy the results.
The script is included as a new message below.
Any feedback is appreciated.
Tom