If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > sqlplus thru shellscript??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-04-06, 01:20
abhinavTCS abhinavTCS is offline
Registered User
 
Join Date: Apr 2006
Posts: 1
sqlplus thru shellscript??

how do i execute sql queries thru shell scripts???
Reply With Quote
  #2 (permalink)  
Old 04-04-06, 04:33
prashant_add prashant_add is offline
Registered User
 
Join Date: Mar 2006
Posts: 25
Unhappy

u can execute queries in sybase thru shell scripts as

open one file using vi editor as
vi filename
isql -Uuser_name -Ppassword -Sserver_name
sqlstatement.........
go
....................
go

save these statements in ur file

and then execute as

sh filename.sh

Quote:
Originally Posted by abhinavTCS
how do i execute sql queries thru shell scripts???

Last edited by prashant_add; 04-04-06 at 06:48.
Reply With Quote
  #3 (permalink)  
Old 04-04-06, 06:41
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
Something like this
Code:
#!/bin/ksh
id=$1
sqlplus -s user/passwd@remoteserver <<EOF
select * from client where id=$id;
EOF

Last edited by pdreyer; 04-04-06 at 07:05.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On