The following startup parameters can be passed to Teradata SQL Assistant on the command line.
When using startup parameters, any parameter value that contains spaces must be enclosed in double quotes.
sqla.exe -c Production1 -s “Select * From MyTbl”
sqla.exe -c Production1 -s Select * From MyTbl
To enter the parameter, from the Windows Start button, select Run.
|Enter this parameter...||to do the following...|
|-a <name>||Automatically load the data contained in the tab delimited file named <name> into an Answerset window.|
|-c <dsn>[ [ \<user> ] \<pwd> ]||Automatically connect to the data source named <dsn>, with optional <user> and <password> parameters.|
The provider type:
|-m [ <mech>\ ] <mechparm>||Connect to the data source using a mechanism. Use this parameter in conjunction with the -c parameter above if a mechanism is required.|
|-s <SQL>||Load this SQL. Automatically execute it if the -c parameter is also specified.|
|-f <name>||Automatically load the SQL contained in the file named <name>. Automatically execute it if the -c parameter is also specified.|
Export the results of your query to a file named <name>. The format of this file is determined with Export options currently in effect.
If the export file is a Microsoft Access database, the file name must be followed by a backslash '\' and the tablename.
For example: -e c:\temp\MyDatabase.mdb\MyTable
|-db <name>||Set <name> as the default database.|
|-cs <name>||Set the session character set to <name>|
- The parameters shown in brackets (for example, [ <mech>\ ]), are optional.
- If -a is entered, it must be the only parameter.
- If both -f and -s are entered, only the last one is used.
- For automatic execution, use -c with either -s or -f.
If the data source requires additional information, you are prompted for that information.
If you provide -c, -e and either -s or -f parameters, Teradata SQL Assistant effectively runs as a batch job. It executes the query, writes any output to the export file, then terminates.
You can also use the Windows Explorer to drag and drop a file onto the Teradata SQL Assistant executable instead of using the -f <name> startup parameter. Alternatively, you can associate a specific file type (such as .sql) with Teradata SQL Assistant. You can then start Teradata SQL Assistant and automatically load the contents of any .sql file by double-clicking on the file.