Documentation 7.0
Aqua Data Studio 7.0
1. Installation
    1.1 Minimum Requirements
    1.2 Installing Aqua Data Studio in Windows OS
    1.3 Installing Aqua Data Studio in Linux OS
    1.4 Installing Aqua Data Studio in Mac OS
    1.5 First steps towards Configuring
    1.6 Character set and Internationalization
2. Server Registration
    2.1 Supported RDBMS Servers in ADS 7.0
    2.2 How to Register a Server in ADS 7.0
    2.3 How to Edit Server Properties
    2.4 How to Copy Server Configurations
    2.5 Troubleshoot Registrations
    2.6 Tips and Tricks
    2.6.1 How to Register a Server Clone
    2.6.2 Tab Coloring to Identify Servers
    2.6.3 Using Filter Options in Registration
    2.6.4 Using Advanced Properties
    2.6.5 Permissions in Server Registration
    2.6.6 Drag and Drop Features
    2.6.7 Navigating with Short cut Keys
    2.6.8 SQL Express 2005
    2.6.9 MSDE 2000
    2.6.10 PostgreSQL SSL
    2.7. JDBC Drivers and Server Registration
        2.7.1 Oracle 8i JDBC Drivers
        2.7.2 Oracle 9i JDBC Drivers
        2.7.3 Oracle 10g JDBC Drivers
        2.7.4 Oracle 11g JDBC Drivers
        2.7.5 DB2 iSeries JDBC Drivers
        2.7.6 DB2 7.2 JDBC Drivers
        2.7.7 DB2 UDB 8.1 and DB2 UDB 8.2
        2.7.8 DB2 UDB 9.0 and DB2 UDB 9.5
        2.7.9 SQL Server JDBC Drivers
        2.7.10 Sybase ASE JDBC Drivers
        2.7.11 Sybase Anywhere JDBC Drivers
        2.7.12 Sybase IQ JDBC Drivers
        2.7.13 Informix JDBC Drivers
        2.7.14 PostgreSQL JDBC Drivers
        2.7.15 MySQL JDBC Drivers
        2.7.16 Apache Derby JDBC Drivers
        2.7.17 SQLite JDBC Driver
        2.7.18 Firebird JDBC Driver
3. Connecting to a Server (CTRL + INSERT)
4. Disconnecting a Server (CTRL + DELETE)
5. Query Analyzer - SQL Tool in ADS 7.0
    5.1 Invoking the Query Analyzer (CTRL+Q)
    5.2 Using the Query Analyzer
    5.3 Query Analyzer and its Environment
    5.4 Using Advanced Properties
    5.5 Parameterized Scripts
    5.6 Displaying Results of Queries
    5.7 Saving Query Results
    5.8 Tips and Tricks
6. SQL History (CTRL+ ALT+H)
7. Automate your SQL scripts using ADS 7.0
    7.1.1 Adding Insert, Update, Delete and Select
    7.1.2 Introduce Columns and Value Stubs
    7.1.3 Comments and Morph to Delimited Text
    7.1.4 Formatting Statements
    7.2 Auto Completion
    7.3 Aqua Commands
8. Query Builder Tool in ADS 7.0
    8.1 Using the Query Builder
9. Charting Tool in ADS 7.0
    9.1 Invoking Charting Tools in ADS 7.0
    9.2 Working with Grids
    9.3 Working with Pivot Grids
    9.4 Advanced Features of Charting Tools
    9.5 Sample Charting Demo
10. SQL Query Tuning - Visual Explain Tools
    10.1 Invoking Execution Plans
    10.2 Using Explain Diagrams
    10.3 Sample Query Tuning Demo
11. GUI Tools for Creating Database Objects
    11.1.1 Creating Tables
    11.1.2 Creating Constraints
    11.1.3 Creating Indexes
    11.1.4 Creating Views and Triggers
    11.1.5 Creating Aliases and Synonyms
    11.1.6 Creating Storage Objects
    11.2 Multi Scripting Objects
12. Tools and Features available in ADS 7.0
    12.1 How to Import Data using ADS 7.0
    12.2 How to Export Data using ADS 7.0
    12.3 Generate SQL Scripts using ADS 7.0
    12.4 Table Data Editor
    12.5 Server Script Generator
    12.6 Using Object Search in ADS 7.0
    12.7 Comparing two Database Schemas
    12.8 Using Explain White Board
    12.9 Using Execution Monitor
    12.10 Generating ER Diagrams
13. Procedure Editor
    13.1 Sample Stored Procedure
14. Function Editor
    14.1 Sample User Defined Function
15. Package Editor
16. SQL Debugger
    16.1 Features of ADS 7.0 Debuggers
    16.1.1 Oracle Debugger
    16.1.2 DB2 Debugger
    16.1.3 MS SQL Debugger
    16.1.4 Sybase Debugger
17. ER Modeler in ADS 7.0
    17.1 Notation and Normalization
    17.2 Working with ER Modeler
    17.2.1 Creating Tables
    17.2.2 Creating Indexes
    17.2.3 Creating Constraints
    17.2.4 Creating Relationships
    17.2.5 Adding Notes and Regions
    17.2.6 Saving an ER Model
    17.3 Forward Engineering
    17.4 Reverse Engineering
    17.5 ER Modeler Demo
18. Version Control in ADS 7.0
    18.1 Using Subversion Repository
    18.2 Using CVS Repository
    18.3 Tips and Tricks
19. DBA Corner
    19.1 ORACLE DBA Tools
    19.1.1 Server Statistics
     19.1.2 Rollback Manager
     19.1.3 Log Manager
     19.1.4 Session Manager
     19.1.5 Instance Manager
     19.1.6 Storage Manager
     19.1.7 Security Manager
     19.1.8 SGA Manager
    19.2 SQL SERVER DBA Tools
    19.2.1 Instance Manager
    19.2.2 Session Manager
    19.2.3 Security Manager
    19.2.4 Storage Manager
    19.2.5 SQL Agent Manager
    19.3 SYBASE DBA Tools
    19.3.1 Instance Manager
    19.3.2 Session Manager
    19.3.3 Security Manager
    19.3.4 Storage Manager
    19.4 MySQL DBA Tools
    19.4.1 Instance Manager
    19.4.2 Session Manager
    19.4.3 Storage Manager
    19.4.4 Security Manager
    19.5 DB2 for LUW DBA Tools
    19.5.1 Instance Manager
    19.5.2 Session Manager
    19.5.3 Storage Manager
    19.5.4 Security Manager
20. Compare Tools in ADS 7.0
    20.1 File Compare
    20.2 Results Compare
    20.3 Directory Compare
    20.4 Tab Compare
    20.5 Schema Compare
    20.6 Copy History Compare
21. Editors available in ADS 7.0
    21.1.1 SQL Editor
    21.1.2 HTML Editor
    21.1.3 XML Editor
    21.1.4 Text Editor
    21.1.5 Regular Expressions
    21.2 Image Viewer
22. Application Workspace and Options
    22.1 Menus and Toolbar
    22.2 Shorcuts
    22.3 Schema and Script Browser
    22.4 Details View
23. Aqua Data Studio 7.0 OPTIONS
    23.1 General Options
    23.2 Editor Options
    23.3 Compare and Results Options
    23.4 Query Analyzer Options
    23.5 Scripts and Results Options
    23.6 Visual Explain Options
    23.7 Formatter Options
    23.8 Permissions and Registration Options
    23.9 Key Mapping Options and Key Assist Tool
    23.10 Settings: Find the application settings
24. Aqua Data Studio Technical Support
    24.1 Error Logging

7.3 Aqua Commands

Query Window - Aqua Commands

Query analyzer scripts have support for 9 client side commands which allow you to execute a stored procedure with local variables bound to the parameters.

This allows for the execution of procedures with OUT parameters. The commands include print, println, variable, executeCallableQuery, sendMail, saveResults, saveLastResult, setResultSettings and setPivotResultSettings.

Client side commands are identified by a dot at the beginning of the command line, and multiple commands can be executed within one batch statement. The schema browser contains object scripting for procedures and functions that include "EXECUTE" and "EXECUTE BIND". The script EXECUTE will generate the appropriate code needed to execute the object according to the database procedural language (ie. PL/SQL, T-SQL). The EXECUTE BIND will generate the appropriate Aqua Data Studio client side commands to execute the object. To easily generate the needed client commands to execute a procedure or function, you may browse in the schema browser to locate the procedure or function and right-click on the object to select "EXECUTE BIND" from the Script Object menus.

Command support

Query Analyzer scripts have support for client side commands ".sendMail", ".saveResults", ".saveLastResult", "setResultSettings", "setPivotResultSettings" which allow users to either save query results in an EXCEL, HTML, XML, or CSV document, or insert them into a table.

The ’sendMail’ command sends emails using the settings you specify and allows attachments.

The ’saveResults’ command saves the results of all of the queries in the window, while the ’saveLastResult’ command only saves the result for the last query.

The ’setResultSettings’ command lays out how grid data will be presented.

The ’setPivotResultSettings’ command lays out how pivot grid data will be presented.

Here is a combination example script using .setPivotResultSettings, .saveResults and .sendMail which runs a query, takes data from that query, laysout and generates a pivot grid result, saves the results to two different Excel files, then emails a message with both Excel files as attachments.

 



.println [.print]

Syntax:
.println { <variable_name> | ’text value’ }[, ... n]

Example:
.println myvar
.println ’ Results:’, OUTVAR



.variable

Syntax:
.variable <variable_name>, datatype [, value]

Example:
.variable myvar, varchar, ’this is a test’
.variable INVAR, NUMBER, 0
.variable OUTVAR, NUMBER, 0
.variable INOUTVAR, DATE, ’2005-01-01 12:00:00 AM’




.executeCallableQuery

Syntax:
.executeCallableQuery ’parameter_name<datatype,{in | out | inout}>[, ... n]’, <LINE_BREAK>
{ CALL <PROCEDURE_NAME>( ? { , ? ... } ) }
or ...
{ ? = CALL <PROCEDURE_NAME>( ? { , ? ... } ) }

Example:
.executeCallableQuery ’INVAR<NUMBER,in>,OUTVAR<NUMBER,out>,INOUTVAR<DATE,inout>’,
BEGIN
    SCOTT.FULL_PROCEDURE(?, ?, ?);
END;

 


.sendMail

Syntax:
.sendMail ’host=mail.aquafold.com,
port=25,
ssl=TRUE,
authentication=TRUE,
user=myuser,
password=mypass,
from=admin@defghi.com,
to="user@abc.net,user1@abc.net, user2@abc.net",
cc="user3@abc.net,user4@abc.net",
bcc="user5@abc.net,user6@abc.net",
subject="New Software Release",
message="Get the latest version of ADS!\nReady for download at www.aquafold.com",
attachments="c:/my directory/abc.xls, D:/another/def.txt"’

Example:
.sendMail ’host=smtp.gmail.com,
port=465,
ssl=true,
authentication=true,
user=<user_name>,
password=<mypassword>,
from=me@mycompany.com,
to=you@yourcompany.com,
subject="Nice document attached",
message="This will blow your sockets off\ncheck it out!",
attachments="c:/abc.xls,c:/abc2.xls"’

 


.saveResults and .saveLastResult
(all of the .saveResults commands work for both .saveResults and .saveLastResult)

.saveResults

Syntax:
.saveResults ’Format=CSV,
File="<filename>",
Delimiter=<delim>,
QuoteIdentifier=<quote_identifier>,
IncludeHeader=<True/False include_header>,
IncludeRowCount=<True/False include_row_count>,
IncludeNullText=<True/False include_null_text>,
NewLine=<plat_new_line>,
Encoding=<encode_full_name>,
Overwrite=<True/False overwrite>’

Syntax:
.saveResults ’Format=XML,
File="<filename>",
QuoteIdentifier=<quote_identifier>,
IncludeHeader=<True/False include_header>,
IncludeRowCount=<True/False include_row_count>,
IncludeNullText=<True/False include_null_text>,
NewLine=<plat_new_line>,
Encoding=<encode_full_name>,
Overwrite=<True/False overwrite>’

Syntax:
.saveResults ’Format=HTML,
File="<filename>",
IncludeSQL=<True/False include_sql_stmt>,
QuoteIdentifier=<quote_identifier>,
IncludeHeader=<True/False include_header>,
IncludeRowCount=<True/False include_row_count>,
IncludeNullText=<True/False include_null_text>,
NewLine=<plat_new_line>,
Encoding=<encode_full_name>,
AlternateRow=<True/False should_alternate_row_color>,
AlternateRowForeground=<alt_row_foreground_color>,
AlternateRowBackground=<alt_row_background_color>,
Overwrite=<True/False overwrite>’

Syntax:
.saveResults ’Format=INSERT,
File="<filename>",
QuoteIdentifier=<quote_identifier>,
IncludeHeader=<True/False include_header>,
IncludeRowCount=<True/False include_row_count>,
IncludeNullText=<True/False include_null_text>,
NewLine=<plat_new_line>,
Encoding=<encode_full_name>,
Overwrite=<True/False overwrite>’

Syntax:
.saveResults ’Format=EXCEL,
Source=<GRID or PIVOT>,
File="<filename>",
IncludeSQL=<True/False include_sql_stmt>,
IncludeHeader=<True/False include_header>,
IncludeRowCount=<True/False include_row_count>,
IncludeNullText=<True/False include_null_text>,
AlternateRow=<True/False should_alternate_row_color>,
AlternateRowForeground=<alt_row_foreground_color>,
AlternateRowBackground=<alt_row_background_color>,
Overwrite=<True/False overwrite>’

Example:
.saveResults ’format=excel,
source=pivot,
file=C:/abc.xls,
overwrite=true’





.setResultSettings

Syntax:

"CategoryFields" is now synonymous with "RowFields"
and
"SeriesFields" is now synonymous with "ColFields"

The List of Aggregate Functions can contain one or more of the following:
Sum, Max, Min, Mean, Var, Stddev, Count

.setResultSettings ’Index=<Index #>,
Title=<Title>,
CategoryFields=<Category Field List>,where a field looks like "[Field Name] {List of Aggregate Functions}
SeriesFields=<Series Field List>,
SortBy=<row | col | data>,
SortOrder=<asc | desc>,
ShowTitle=<True or False Show Title>,
TopCount=<Top Count>,
ShowTopCount=<True or False Show Top Count>,
ShowLegend=<True or False Show Legend>,
ShowChart=<True or False Show Chart>,
Chart=<area | bar | column | line | pie | surface | stacked>,
ScaleData=<True or False Scale Data>,
RotX=<Rotation X in degrees>,
RotY=<Rotation Y in degrees>,
RotZ=<Rotation Z in degrees>,
Zoom=<Zoom [ 0.0-100.0]>,
Split=<Split Divider Location [0.0-1.0]>,
Paging=<True or False Paging>,
Paging=<RowsPerPage>’

Example:
.setResultSettings ’Index=1,
Chart=column,
RotX=325,
RotY=53,
RotZ=0,
Zoom=50.0,
ScaleData=true,
ShowChart=true,
ShowLegend=true,
ShowTitle=false,
ColFields="[ShipCountry]",
DataFields="[Freight]",
Paging=true,
ShowTopCount=false,
Split=0.35460994’





.setPivotResultSettings

Syntax:

"CategoryFields" is now synonymous with "RowFields"
and
"SeriesFields" is now synonymous with "ColFields"

The List of Aggregate Functions can contain one or more of the following:
Sum, Max, Min, Mean, Var, Stddev, Count

.setPivotResultSettings ’Index=<Index #>,
ShowFields=<True or False to show list of unselected fields>,
ShowTotal=<True or False to Show Total Columns>,
ShowSubTotal=<True or False to Show SubTotal Columns>,
Title=<Title>,
RowFields=<Row Field List>,where a field looks like "[Field Name] {List of Aggregate Functions}
ColFields=<Column Field List>,
DataFields=<Data Field List>,
SortBy=<row | col | data>,
SortOrder=<asc | desc>,
ShowTitle=<True or False Show Title>,
TopCount=<Top Count>,
ShowTopCount=<True or False Show Top Count>,
ShowLegend=<True or False Show Legend>,
ShowChart=<True or False Show Chart>,
Chart=<area | bar | column | line | pie | surface | stacked>,
ScaleData=<True or False Scale Data>,
RotX=<Rotation X in degrees>,
RotY=<Rotation Y in degrees>,
RotZ=<Rotation Z in degrees>,
Zoom=<Zoom [0.0-100.0]>,
Split=<Split Divider Location [0.0-1.0]>,
Paging=<True or False Paging>,
Paging=<RowsPerPage>’

Example:
.setPivotResultSettings ’Index=1,
Chart=column,
RotX=324,
RotY=12,
RotZ=0,
Zoom=50.0,
ScaleData=true,
ShowChart=false,
ShowLegend=true,
ShowTitle=false,
RowFields="ShipCountry",
ColFields="ShipVia",
DataFields="Freight",
Paging=true,
ShowTopCount=false,
Split= 0.5,
ShowFields=true,
ShowTotal=true,
ShowSubTotal=true’



COMBINATION EXAMPLE SCRIPT


select * from orders

GO

.setPivotResultSettings ’Index=1,
Chart=column,
RotX=324,
RotY=12,
RotZ=0,
Zoom=50.0,
ScaleData=true,
ShowChart=false,
ShowLegend=true,
ShowTitle=false,
RowFields="ShipCountry",
ColFields="ShipVia",
DataFields="Freight",
Paging=true,
ShowTopCount=false,
Split= 0.5,
ShowFields=true,
ShowTotal=true,
ShowSubTotal=true’

GO

.saveResults ’format=excel,
source=pivot,
file=C:/abc.xls,
overwrite=true’

GO

.saveResults ’format=excel,
source=pivot,
file=C:/abc2.xls,
overwrite=true’

GO

.sendMail ’host=smtp.gmail.com,
port=465,
ssl=true,
authentication=true,
user=<user_name>,
password=<mypassword>,
from=me@mycompany.com,
to=you@yourcompany.com,
subject="Nice document attached",
message="This will blow your sockets off\ncheck it out!",
attachments="c:/abc.xls,c:/abc2.xls"’

 

GO