Solved

Sybase insert and update through unix bash script

Posted on 2011-03-12
2
655 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Challenging SQL Update 5 49
Webservices in T-SQL 3 34
Downgrading MS SQL 2008 R2 Enterprise to MS SQL 2005 Standard? 12 66
SQL Error - Query 6 42
     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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