HI,
I'm trying to pass parameters from a shell script to an SQL file.
Here's my shell script:
And here's the SQL file:
when i run the shell script i get this error:
I'm not sure why i'm getting this error, is it because I can't specify the parameters in the same script that i'm using to run the sql? I'm a bit new to this scripting malarky so am really struggling to get my head around the issue.
Thanks
I'm trying to pass parameters from a shell script to an SQL file.
Here's my shell script:
Code:
for TAB_NAME in INX_CDM_DREPORT_DATES INX_CDM_PDBAND
do
echo "Selecting from table $TAB_NAME"
db2 -tvf /gcdm/dev/scripts/ControlMScripts/dailyMI/andytemp/sample.sql $TAB_NAME
done
Code:
select * from '#TAB_NAM#' with ur
when i run the shell script i get this error:
Selecting from table INX_CDM_DREPORT_DATES
DB21004E You cannot specify both an input file and a command when invoking
the Command Line Processor.
Selecting from table INX_CDM_PDBAND
DB21004E You cannot specify both an input file and a command when invoking
the Command Line Processor.
I'm not sure why i'm getting this error, is it because I can't specify the parameters in the same script that i'm using to run the sql? I'm a bit new to this scripting malarky so am really struggling to get my head around the issue.
Thanks