Solved

Sybase insert and update through unix bash script

Posted on 2011-03-12
2
648 Views
Last Modified: 2012-05-11
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_status fs
            where cobDate= '20110311' and
              fs.clientId=2
           )
        update custodymktval_inbound_status
           set processStartTime=getdate()
         where cobDate= '20110311'
           and clientId=2

  else
insert into custodymktval_inbound_status
values (2,'ZRC',getdate(),getdate(),'20110311','N')
0
Comment
Question by:sunilbains
2 Comments
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 35118254
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.
0
 
LVL 13

Accepted Solution

by:
alpmoon earned 500 total points
ID: 35130207
I am guessing that you are missing "go" at the end.

You can check answers there as well:

http://www.experts-exchange.com/Database/Sybase/Q_24902478.html?sfQueryTermInfo=1+10+30+isql+unix
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now