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
Script executing sql query kingluke Shell Programming and Scripting 2 01-23-2008 01:57 PM
Dynamic update loop query on Sybase database Alaeddin Shell Programming and Scripting 10 12-13-2007 06:26 AM
Executing Sql Query Using Shell Script ragha81 Shell Programming and Scripting 14 07-31-2006 02:15 PM
need help getting console driver number(index) axujet UNIX for Dummies Questions & Answers 1 06-15-2004 06:33 PM
Executing a SQL query from a shell script 98_1LE UNIX for Dummies Questions & Answers 3 03-23-2002 03:29 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-13-2007
Alaeddin Alaeddin is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 15
Print out loop index on the console after executing each sybase DB query

Hello Guys,

Well, using shell script, I'm doing loop on DB query as below:

isql -Usa -Ptest -I /opt/sybase/interfaces << EOF
use testdb
go
declare @i int
select @i = 1
while(@i <= 5)
begin
Insert into TEST values (@i,"Test","TestDesc")
select @i = @i + 1
end
go
EOF

The Issue here, that i want to print out the index on the console for each loop after the insertion has been done, or redirect the indexs to a file.

Ex: echo "Row @i has been inserted"

But i tried to put this echo after the insertion, but gave me error, any advice !!!!

Tha idea behind that, i want to know what indexes have been inserted successfully !!!

Thanks,
- Ala'eddin
 

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 05:31 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