I am trying to export a query from
Teradata Studio 14.10 /
Aster using the
ncluster_export command line function. I can't find a working example to go off of. Does anyone have one they could share? Also how would I actually run the script (ie
Assume the following :
File location: 'myhomedir' Username: 'user1' Password: 'pass1' Outfile name: 'outFile1.csv'Answer1:
If you want to export a result set from Teradata Studio then you can do that from the "Teradata Result Set Viewer" window. There's an export icon on the top right corner.
If you want to run a SQL script then export the results to a file then you should use ACT rather than
The syntax is -
act -h QueenIPaddress -U user1 -w pass1 -f myscript.sql -o $myhomedir/outFile.csv -F ','
This will pass a SQL script to Aster and redirect the output to the specified file. The
-F parameter specifies the delimiter.
There are other parameters you can use. act --help will list themAnswer2:
I can't test it right now, but I don't think you can use a ncluster_export directly within TD Studio, you need to run it on your PC's command line.
Did you install the Aster Client Tools on your PC running TD Studio?
Then it should be (you seem to be on Windows):<ul><li>start the command line (cmd) and enter</li> <li>cd myhomedir</li> <li>ncluster_export --hostname ip_of_asterqueen --username user1 --password pass1 --csv schemaname.tablename outFile1.csv</li> </ul>
Regarding running the script, you can't pass the parameters to cluster_export (afaik) in a file, but you can put the commands in a <em>bat</em>-file and then execute this.