Connect to DB inside awk script
2 answers
Just use some command line client for your SQL database (if any) and output to awk
.
eg. with sqlite
(I don't know what the SQL * Plus client has):
echo "select * from foo;" | sqlite3 file.db | awk ...
awk
can't do it. This is the philosophy of UNIX tools, instead of having few tools that do many things, you use many small tools that do a single task and put them together.
+2
source to share