Paste SQL Statements
The multi-purpose pasting facility offers the following:
- Build SELECT, UPDATE, INSERT, DELETE, or EXEC statements and subsequently paste into the SQL Editor. Function calls can also be generated and pasted.
- Paste comma-separated lists of defaults, functions, indexes, packages, procedures, rules, tables, triggers, user datatypes, or views into the SQL Editor. Similarly, you can paste lists of table or view column names, procedure parameter names, or function argument names into the SQL Editor.
To generate a SELECT, INSERT, UPDATE, DELETE or EXEC statement or a function call
- Open a SQL Editor against the DBMS platform you want to work against. For details, see Coding Environments/Editors.
- Select Edit > Paste SQL Statement. A Paste SQL dialog opens.
- Use the Datasource, Database (if available), and Owner controls to specify the location and ownership of the object you want to generate the statement or call from.
- From the Object Type list, select Tables or Views to generate a SELECT, UPDATE, INSERT, or DELETE, statement, Procedures to generate an EXEC statement, or Functions to generate a function call.
- If you selected an Object Type of Tables or Views, select one of the Select, Update, Insert, or Delete radio buttons corresponding to the type of statement you want to generate and paste.
- In the left list (which will be labelled Functions, Procedures, Tables, or Views), select the specific object on which the generated statement or function call will be based. The middle list is populated with the columns, arguments, or parameters for the left list object you selected.
- In the middle list, select the specific columns, arguments, or parameters that are to appear in the statement or function call.
- The right list is populated with the generated statement or function call.
- If necessary, edit the right list, to provide valid argument values for example.
- Click Paste Statement (or Paste Syntax).
At any time that the left or middle lists are populated, you can select multiple items in that list and click the associated Paste... button. This pastes a comma-separated list of those elements to the SQL Editor.