Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sybase insert and update through unix bash script

Posted on 2011-03-12
2
Medium Priority
?
668 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

972 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