Connect to sybase database using Korn shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Connect to sybase database using Korn shell script
# 1  
Old 08-08-2005
Data 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  
Old 08-08-2005
Have a look here.
# 3  
Old 08-08-2005
Hi thanks, but can you please let me know where to give the server details like ip or machine name.
# 4  
Old 08-08-2005
Add -S to the isql call and include the server name.

Code:
isql -Uuser -Ppassword -Sserver <<EOF
your sql here
EOF

# 5  
Old 08-09-2005
Bug

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  
Old 08-09-2005
Isnt it answered in this post.

You have the queried results in the variable $results.

Use a echo $results > output.txt

vino
# 7  
Old 08-09-2005
Bug

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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to connect to Oracle database using shell script?

Hi All, I am newbie to unix shell scripting. I want to connect to oracle database using shell script. I know how to connect DB using user name and password but my question is if my password is having '@' sign then how to connect. I have tried like below, cnt=`sqlplus -s /nolog << EOFSQL ... (3 Replies)
Discussion started by: pmotewar
3 Replies

2. Shell Programming and Scripting

Shell Script to connect to the oracle database

Hi Unix Gurus, I have a requirement to write a script, Oracle DB gets referesh every 6hrs, hence we need write a script to connect to the database , if it connects it should generate a file to proceed the next job application or when an error when connectiong to DB it should not generate any... (8 Replies)
Discussion started by: bshivali
8 Replies

3. Shell Programming and Scripting

Korn Script to connect and query oracle database

I've been sent the following script to finish. It's supposed to connect to an oracle database, query it, and send an email if the query result value is one or more. Currently it isn't connecting properly, just giving the following error: ERROR: ORA-01017: invalid username/password; logon denied... (2 Replies)
Discussion started by: jackmorgan2007
2 Replies

4. Shell Programming and Scripting

Database connection from korn shell prompt

Hello, I want to connect to Database through shell command line. Here is my command from putty, $ sqlplus -S ora/ora@ORA But I am not able to connact to database. If this command succed, what is the expected output on shell prompt? Could you please let me know how to connact to... (3 Replies)
Discussion started by: Poonamol
3 Replies

5. Shell Programming and Scripting

Unix Korn Shell script on Solaris to DB2 UDB LUW database

I am rather new to korn shell scripting and attempting to write a Unix script that would detach, attach a range partition table in DB2 UDB LUW database. This would be a job scheduled in control M that reads in an input file with 5 parameters passed to it from the application. I don't have much... (1 Reply)
Discussion started by: tjhanso
1 Replies

6. Windows & DOS: Issues & Discussions

how to connect to sybase database?

hi, I'd like to connect to a Sybase ASE 12 through a a graphic user interface (GUI) that run on windows and solaris10, because i need to do some querys. The database is running on solaris 10. I'm not an expert using databases, but i know how to use some SQL commands through command line... (3 Replies)
Discussion started by: danin
3 Replies

7. Shell Programming and Scripting

how will i connect postgres database from unix shell script

I have got the solution so just closing this issue. (3 Replies)
Discussion started by: jambesh
3 Replies

8. Shell Programming and Scripting

How to connect to database db2 through Unix Shell Script

I am trying to connect to database db2 through shell script. The process I am trying is > db2 It gives me error Access Denied. While checking for access I have the rights. Is there ant other way round..? Please help. (3 Replies)
Discussion started by: ankitgupta
3 Replies

9. Shell Programming and Scripting

Connect to a Remote Sybase Server Through Script

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (3 Replies)
Discussion started by: Aparna_k82
3 Replies

10. Windows & DOS: Issues & Discussions

Connect to a Remote Sybase Server Through Script.

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (2 Replies)
Discussion started by: Aparna_k82
2 Replies
Login or Register to Ask a Question