Jayaprakash,
I think that you are passing parameter in db2 so you are getting the error.
db2 -tf backup_status.sql $1 > backup_status_db.out
As the method you are using for parameter passing is for UNIX/AIX so
Try to make the script UNIX comptable and run it as a UNIX script.
with regards,
Jagdish S. Rawat
IBM Certified DB2 DBA
IGSI, DLF Infinity Tower A, 4th Floor,
DLF Phase-II, NH-8,
Gurgoan -122001
Ph.# +91-124-4347152(Direct) +91-124-4347000 Ext. # 47152
Fax# +91-124-2566701
Mob# +919818433596
(Embedded image moved to file: pic28730.jpg)
"Jayaprakash.Band
aru "
<db2udbdba-ezmlms To
hield-x12464443.x "LazyDBA Discussion"
[Email Address Removed] <[Email address protected]
a.com> cc
08/29/2006 11:27 Subject
AM RE: How to pass the parameters to a
sql at runtime.
Any idea about this?
-----Original Message-----
From: Jayaprakash.Bandaru
Sent: Monday, August 28, 2006 4:44 PM
To: LazyDBA Discussion
Subject: How to pass the parameters to a sql at runtime.
Hi All,
I need to execute a sql in the shell script. While executing the script,
I need to pass no of days at runtime.
Eg.
This is my backup stus sql file.
more backup_status.sql
select timestampdiff(4,char(timestamp(end_time)-timestamp(start_time)))
as "Duration (min)",
substr(firstlog,1,13) as "Start Log", substr(lastlog,1,13) as
"End Log",
num_tbsps as "No.Of tbspcs",
case(operationType)
when 'F' then 'Offline Full'
when 'N' then 'Online Full'
when 'I' then 'Offline Incremental'
when 'O' then 'Online Incremental'
when 'D' then 'Offline Delta'
when 'E' then 'Online Delta'
else '?'
end as Type,
date(timestamp(end_time)) as "Day Completed",
time(timestamp(end_time)) as "Time Completed", from list_history
where operation = 'B' and
date(timestamp(end_time)) > ( current date - &dd days);
I am executing this in the script,db2 -tf backup_status.sql $1 >
backup_status_db.out.
When I execute backup_status.sh, it is throwing the error:
DB21004E You cannot specify both an input file and a command when
invoking the Command Line Processor.
Any suggestions please?
Jayaprakash.
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page