1

I am trying to check the activity count for each and every sql present in a sql file which is run using a bteq script in Unix . Following is the code snippet I am trying to use but the activity count is checked for the last sql but not for all sql's in test.sql which has say 5 sql's .

.logon -----/&&&&&,******
.os rm /home/lankirn/venkat/output.txt
.os touch /home/lankirn/venkat/output.txt
.export FILE /home/lankirn/venkat/output.txt
.run FILE=/home/lankirn/venkat/test.sql

.IF ACTIVITYCOUNT > 0 THEN .GOTO Continue
ELSE
.os rm /home/lankirn/venkat/pass.txt
.os touch /home/lankirn/venkat/pass.txt
.EXPORT DATA FILE =/home/lankirn/venkat/pass.txt
SELECT 'Data not Found';
.LABEL Continue
.os rm /home/lankirn/venkat/pass.txt
.os touch /home/lankirn/venkat/pass.txt
.EXPORT DATA FILE =/home/lankirn/venkat/pass.txt
SELECT 'Data Found';

.QUIT

Kindly help me to check the activity count of each and every sql so that i can export if the sql is returning any rows or not to a text file

venkat
  • 77
  • 3
  • 11

1 Answers1

2

You cannot. You have to insert activity_count checking after each query in your test.sql. Or else you can simply run your select queries first without export mode on..check activity_count of each query and then trigger the export.

Rony
  • 196
  • 2
  • 15