Print out loop index on the console after executing each sybase DB query

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Print out loop index on the console after executing each sybase DB query
# 1  
Old 12-13-2007
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
declare @i int
select @i = 1
while(@i <= 5)
Insert into TEST values (@i,"Test","TestDesc")
select @i = @i + 1

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 !!!

- Ala'eddin
# 2  
Old 12-13-2007
Hey Guys, any Advice please .... !!!!
# 3  
Old 12-16-2007
Hey Guys, please help in That .... !!!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Sybase ASE - Query Tuning - Need Suggestion

Dear Team Please provide suggestion on below query which is used in Sybase Adaptive Server Enterprise/15.7 (ASE). Query takes more time > 30 Mins to 1 Hr All required indexes are built Can we have any efficient approach to get the data retrieval faster for below query.Any help... (0 Replies)
Discussion started by: Perlbaby
0 Replies

2. Programming

Sybase ASE: Query to find correct format issue.

Hi Team , I am new to Sybase Adaptive Server Enterprise/15.7 (ASE) and need some guidance to find the different values in serial format column. SELECT DISTINCT SERIAL_FORMAT FROM PRODUCTS It has values with below format which contains 12 digits hexadecimal characters with... (2 Replies)
Discussion started by: Perlbaby
2 Replies

3. Programming

Hierarchical Query for Sybase database

Team I am using DBartisan tool for sybase database. I have a table that has below fields Employee_ID,EMP_Name,First_Nm,Last_Nm,Emp_Designation,Employee's_Manager is it possible to retrieve hierarchical data based on below fields Emp_Designation will have Soft Engg,SSE,Team Lead,... (6 Replies)
Discussion started by: Perlbaby
6 Replies

4. Shell Programming and Scripting

file index operation in loop

i have one file which contains data like the below DE_CODE|AXXANY|APP_NAME|TELCO|LOC|NY DE_CODE|AXXATX|APP_NAME|TELCO|LOC|TX DE_CODE|AXXABT|APP_NAME|TELCO|LOC|BT DE_CODE|AXXANJ|APP_NAME|TELCO|LOC|NJ DE_CODE|AXXANJwt|APP_NAME|TELCO|LOC|WT am going use a for loop or whole loop which will... (3 Replies)
Discussion started by: mail2sant
3 Replies

5. Shell Programming and Scripting

dynamic index for array in while loop

Hi, I'm just trying to use a dynamic index for some array elements that I'm accessing within a loop. Specifically, I want to access an array at variable position $counter and then also at location $counter + 1 and $counter + 2 (the second and third array positions after it) but I keep getting... (0 Replies)
Discussion started by: weak_code-fu
0 Replies

6. Shell Programming and Scripting

Executing Shell Script from Within a Sybase Stored Proc

Greetings, I need to make an open server call to a shell script from inside a Sybase Stored procedure. Coul any one please provide a sample code? TIA (0 Replies)
Discussion started by: rajpreetsidhu
0 Replies

7. Programming

Need help with complex SQL query (Sybase)

Hello, I have three tables. I need an SQL query (preferably Sybase) that will return all of the stringID values of table B where the following conditions exist: (1) B.intID = A.intID (2) B.intID != C.intID or (B.intID = C.intID and (C.v1 = 0 or C.v2... (2 Replies)
Discussion started by: chatieremerrill
2 Replies

8. Shell Programming and Scripting

Dynamic update loop query on Sybase database

Hello Guys, I'm new to Shell scripting, and i need someone to help me with this issue: I'm trying to do a dynamic update query on Sysbase database table using shell script. Lets say, the Update query is "update Table set id=X" , where X is dynamic value for the loop index. If the loop is... (10 Replies)
Discussion started by: Alaeddin
10 Replies

9. UNIX for Dummies Questions & Answers

need help getting console driver number(index)

Well, i have a little problem here. I am given device "console" of symbolical type. I do need to get its driver's number (index ?) Your help would be greatly appreciated thx, axujet (1 Reply)
Discussion started by: axujet
1 Replies
Login or Register to Ask a Question