You redirect the result of one or more SQLCLI commands to a <file>.
Enter the following command:
\o <file>
Note
Enter the full path of the file.
Enter the command whose result is to be redirected to the <file>.
<command>
To enter multiple commands in succession, press Enter after each command.
To stop redirection to a file, enter \o.
Log on to the DEMODB database as user MONA with the password RED:
sqlcli -d DEMODB -u MONA,RED
Create the file c:\tmp\redirected.txt to which SQLCLI is to redirect the result:
\o c:\tmp\redirected.txt
Enter the following command:
\ds
Enter another command (SQL statement).
select * from HOTEL.CUSTOMER
Stop redirection to the file.
\o
The redirected.txt file now has the following content:
| Schema name | Owner name |
| ----------- | -------------------------------- |
| DBADMIN | DBADMIN |
| DBM | DBM |
| DOMAIN | DBADMIN |
| HOTEL | MONA |
| MONA | MONA |
| OMS | DBADMIN |
| SYSINFO | DBADMIN |
| CNO | TITLE | FIRSTNAME | NAME | ZIP | ADDRESS|
| ------ | ------- | ---------- | ---------- | ----- | -------|
| 3200 | Company | ? | Datasoft | 90018 | 486 Maple Str.|
| 3400 | Mrs | Mary | Griffith | 20005 | 3401 Elder Lane|
| 3500 | Mr | Martin | Randolph | 60615 | 340 MAIN STREET, #7|
| 3600 | Mrs | Sally | Smith | 75243 | 250 Curtis Street|
| 3700 | Mr | Mike | Jackson | 45211 | 133 BROADWAY APT. 1|
| 3900 | Mr | George | Howe | 75243 | 111 B Parkway, #23|
| 4000 | Mr | Frank | Miller | 95054 | 27 5th Str., 76|
| 4400 | Mr | Antony | Jenkins | 20903 | 55 A Parkway, #15|
...