Script Commands
Script Commands provide ability to access some of the functionality which is available through different menus
where:
Supported Script Commands:
cmd results = grid | text Set results output destination cmd results_only = Y | N Include results only cmd result_new = [name] Add new result tab and make it current cmd result_current = name Set current result tab cmd result_name = name Set result tab name cmd export = excel [format = smart | text] [tab=name] Export to Excel using format. Set worksheet tab name to name cmd export = file filename Export to file cmd diff Add result to Quick Diff cmd print_message ['] message text ['] Add message to Messages tab cmd format = transpose | group; [group = column_list]; [total = column_list] Format results |
Remarks
Some script commands has to be placed before SQL statement they affect in SQL batch or the only statement in the batch.
Following commands has to be placed before: results, results_only, result_new, result_current, export
Other command can be placed before or after. They will affect current results in Result Grid.
Export script command applies to the next SQL statement. For example to export result of the query to excel
CMD format
cmd format can be used to format results in Result Grid. format=transpose will transpose current result set. format=group will enable column grouping and should be followed with group=column_list and optionally total=column_list. Below is the example of query which uses format script command