sunilbains
asked on
Sybase insert and update through unix bash script
How can i perform sybase insert and update throough unix script.
I am performing following through isql and getting nothing but when i try running manually , it works.
if exists (select 1
from custodymktval_inbound_stat us fs
where cobDate= '20110311' and
fs.clientId=2
)
update custodymktval_inbound_stat us
set processStartTime=getdate()
where cobDate= '20110311'
and clientId=2
else
insert into custodymktval_inbound_stat us
values (2,'ZRC',getdate(),getdate (),'201103 11','N')
I am performing following through isql and getting nothing but when i try running manually , it works.
if exists (select 1
from custodymktval_inbound_stat
where cobDate= '20110311' and
fs.clientId=2
)
update custodymktval_inbound_stat
set processStartTime=getdate()
where cobDate= '20110311'
and clientId=2
else
insert into custodymktval_inbound_stat
values (2,'ZRC',getdate(),getdate
When you say "running it manually", do you mean in a SQL tool of some kind? Are you logging into isql using the same credentials? My initial instinct, especially if the SQL runs okay (aside from not returning anything) is that you're lacking some permissions that your SQL user has but the user you're using for isql does not.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.