SQL Mail Merge
The primary function of SQL Mail merge is to create a file of exported data on the basis of an SQL Select query, typically for use in a mail merge Word document. The data may also be used for analysis in Excel, for example.
Only SQL statements that begin with the word Select are allowed. All other commands such as Update, Insert or Delete are prohibited and will fail validation.
Once the file is created you can export the data to a nominated file folder on the system’s network or to a local machine.
Before creating SQL Mail Merge, users and user groups must be set up via v4 Client | Tools | Administration | User Management | User Accounts/User Groups.
The SQL Mail Merge query is set up by the system administrator in v4 Online. The system administrator nominates which users and user groups may initiate the query.
- Create SQL Mail MergeCreate SQL Mail Merge
To create a new SQL Mail Merge:
- In One v4 Online, select Administration | System Admin |
SQL Mail Merge to display the SQL
Mail Merge Query page.
- Click the Add
New Query button to display the Query
Name dialog.
- Enter details as required.
- Click the Save
button to display the SQL
Statement field.
Information is given in the Parameters panel displaying parameters that are available to use within the clause of the SQL statement.
- Enter the SQL Statement text. Only SQL statements that begin with the word Select are allowed.
- Click the Save button to display
the SQL statement.
- Choose from the following options:
- Click the Preview
button on the Parameters
panel to display the SQL
Mail Merge dialog.
This displays the results of the SQL query. - Click the Export
button on the Parameters
panel to display the Save
Output As dialog.
This enables you to save the files and export the queries.
- In One v4 Online, select Administration | System Admin |
SQL Mail Merge to display the SQL
Mail Merge Query page.
- Add Users to SQL Mail MergeAdd Users to SQL Mail Merge
To add users to the SQL Mail Merge:
- Click the Users
tab to display the Users
page.
- Click the Edit
button to display the Users
Filter dialog.
- Search for and select users as required.
- Click the Users
tab to display the Users
page.
- Add Groups to SQL Mail MergeAdd Groups to SQL Mail Merge
To add user groups to the SQL Mail Merge:
- Click the User
Groups tab to display the User
Groups page.
- Click the Edit
button to display the Groups
Filter dialog.
Clicking the plus sign next to a group displays the list of users in that group. - Search for and select groups as required.
- Click the User
Groups tab to display the User
Groups page.
Use the SQL Mail Merge Button
The SQL Mail Merge button displays in many areas of v4 Online. Clicking the SQL Mail Merge buttonbutton only allows you to preview and export existing queries.
A&T Back Office, Applications, Bases, Music Tuition or Training Manager
CSS & Governors
Transport Back Office
To preview and export an existing query:
- In v4 Online, select an entity for which an SQL mail merge has been created.
- Click the SQL Mail Merge button to display the SQL Mail Merge Search Filters dialog.
The Context is populated according to the entity where the SQL Mail Merge button was selected.
- If required, enter the SQL Query Name in the Looking For field to search for the SQL mail merge.
- Select the required SQL Query Name and choose from the following options:
- click the Preview button to display the SQL Mail Merge Preview dialog.
You may need to use the scroll bar to view all of the results.
- Click the Export button to display the Save As dialog.
Save the file to the desired location.
- click the Preview button to display the SQL Mail Merge Preview dialog.