The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how will i connect postgres database from unix shell script jambesh Shell Programming and Scripting 3 07-16-2008 11:09 AM
How to connect to database db2 through Unix Shell Script ankitgupta Shell Programming and Scripting 3 10-31-2006 09:50 AM
Connect to a Remote Sybase Server Through Script Aparna_k82 Shell Programming and Scripting 3 02-17-2006 11:59 AM
Script to connect to As400 database mgirinath Shell Programming and Scripting 0 12-01-2005 04:20 PM
Connect to a Remote Sybase Server Through Script. Aparna_k82 Windows & DOS: Issues & Discussions 2 06-23-2005 11:26 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-08-2005
bhgopi bhgopi is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 6
Unhappy Connect to sybase database using Korn shell script

Hi,

Can anyone please give me a script or let me know how to connect to a sybase database and execute a query using Korn shell scripts.Am new to Unix but i need to do this ASAP.

Please help.

Thanks,
Gops
  #2 (permalink)  
Old 08-08-2005
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
Have a look here.
  #3 (permalink)  
Old 08-08-2005
bhgopi bhgopi is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 6
Hi thanks, but can you please let me know where to give the server details like ip or machine name.
  #4 (permalink)  
Old 08-08-2005
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
Add -S to the isql call and include the server name.

Code:
isql -Uuser -Ppassword -Sserver <<EOF
your sql here
EOF
  #5 (permalink)  
Old 08-09-2005
bhgopi bhgopi is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 6
Smile

Quote:
Originally Posted by tmarikle
Add -S to the isql call and include the server name.

Code:
isql -Uuser -Ppassword -Sserver <<EOF
your sql here
EOF
Hey Thanks it works..

Is there a way to directly write the result of a select query into a file or should we only loop through and write into file.

Gops
  #6 (permalink)  
Old 08-09-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Isnt it answered in this post.

You have the queried results in the variable $results.

Use a echo $results > output.txt

vino
  #7 (permalink)  
Old 08-09-2005
bhgopi bhgopi is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 6
Smile

Quote:
Originally Posted by vino
Isnt it answered in this post.

You have the queried results in the variable $results.

Use a echo $results > output.txt

vino

Missed it ...Thanks anyway
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0