I have data from a Teradata server and a DB2 – Iseries server that I would like to output in one FluidShell command. Is there a way using FluidShell to run SQL code for multiple servers?
Thomas Conrad over 5 years ago
You cannot have two active databases at the same time. In FluidShell, you can execute the ‘connect’ command multiple times to create multiple connections to different servers; however, there is only one that can be assigned as the ‘current connection’. In FluidShell, you can
use the ‘session’ command to manage all of connections created in a FluidShell, e.g. close a connection, change ‘current connection’, list all of active connections.
In FluidShell, when SQL commands are executed, the output is always written to FluidShell’s STDOUT. We cannot redirect SQL command’s output to a file so pipe and ‘redirecting out’ won’t work for SQL commands. In addition, execution of SQL commands always uses the ‘current connection’, hence, FluidShell cannot communicate with multiple DB servers on one single SQL command execution.
For database related FluidShell commands such as sqlexport and sqlimport, it is a different story. These commands handle STDIN and/or STDOUT, as well as providing the option to connect to an ‘active connection’ rather then using the ‘current connection’; so it is possible to
run these commands as a pipe or redirect a command’s output to a file if the command supports output to STDOUT. For example, it is possible to do something like “sqlexport > file” or “sqlexport | sqlimport”.
Have a look at the attached screenshot which demonstrates the above examples.
Gregg Blachstein over 5 years ago
Thanks for the detailed explanation. I’ll give it a try.