I am trying to create query explain tables using db2exfmt. I am using db2 CLP and I am following below steps:
set current explain mode explain
select * from staff where JOB = 'Sales'
db2exfmt -d sample -# 0 -w -1 -g -TIC -n % -s % -o output.txt
After the last step, I am getting this output:
Connecting to the Database.
Connect to Database Successful.
Unable to open output file.
I am not sure why it is not able to open output file. How should I resolve this issue?
It appears that you don't have write access to the C:\Program Files\IBM\SQLLIB\BIN
directory, so db2exfmt
can't open the output file for writing.
Change to a directory you do have write permissions, or specify a file name with path for the -o
option.