This is a reimplementation of the old oracle_request tool in case of the old language tcl and oracle only access. The arguments should be the same and may be some useful enhancements for a better flexible usage.
Usage: db_request.py [Options] [Statement] if no statement as argument was given, it will be asked from stdin
make a request to a rdbms with a sql statement
--version | show program's version number and exit |
-h, --help | show this help message and exit |
-u USER, --user=USER | |
set username | |
-p PASSWORD, --password=PASSWORD | |
set password | |
-r SERVER, --server=SERVER | |
set database server (connection type 'oci' will ask for, 'oci8' not) | |
-l PORT, --port=PORT | |
set database server port (connection type 'oci' will ask for, 'oci8' not) | |
-d DATABASE, --database=DATABASE | |
set name of database instance | |
-c CONNECTTYPE, --connecttype=CONNECTTYPE | |
defines connectiontype to database, (odbc,access,mssql ,mysql,mxodbc,oci8,oci,postgres,postgres8,sqlite) | |
-x PROFILE, --profile=PROFILE | |
using profile for shortcutted connects to database, (devices2,devices2015,devices,mirror) | |
-n NONE, --none=NONE | |
don't execute sequel command | |
-o FORMAT, --format=FORMAT | |
decide the output format (xml,c,csv,tab,python,txt,html,json,php,perl) | |
--header | enable header of columns |
--doc | create online help in restructured text format. Use "./db_request.py --doc | rst2html" for creation of html help |
-t, --test | performs simple self-test |
--idx | write at first the line number, like a line counter |
--protocols | list of known database protocols |
--profiles | list of known connection profils |
--formats | list of known output formats and examples |
-v, --verbose | writes additional informations |
xml format:
<row> <value>example</value> <value>123</value> <value /> <value>4.56</value> </row>
c format:
example 123 {} 4.56
csv format:
"example","123",,"4.56"
tab format:
"example" "123" "4.56"
python format:
('example', '123', None, '4.56')
txt format:
"example","123",NULL,"4.56"
html format:
<tr> <td>example</td> <td>123</td> <td> </td> <td>4.56</td> </tr>
json format:
{'example','123',null,'4.56'},
php format:
["example","123",null,"4.56"],
perl format:
["example", "123", "", "4.56"],