Solved

Sybase insert and update through unix bash script

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
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…

777 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