Hi
I have created about 50 SQL statements to run against a DB2 database. Each SQL query is contained in a file for example XML-name.sql
I have written a bash script to cycle through each of the files and execute them against the database. Here is the shell script.
#!/bin/sh
find . -name "*.sql" | while read f; do db2 -tvf $f > /tmp/$f.txt; done
The script executes and creates the files. However each of the output files contains the following error.
"DB21004E You cannot specify both an input file and a command when invoking the Command Line Processor".
I have only been using DB2 for about a week so im a total newbie when it comes to it. It seems crazy to me that I cant use a statement thats contained in a file and write the results to a different text file.
Is there any workaround to this issue?
Thanks
Eamo