[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] if not exists (select * from sysobjects where name='<>') = processing should stop



This should do it.  I'd check on whether or not you need to look against
uppercase letters in sysobjects.  I believe it would need to be
'TRANSACTION_TABLE' in Oracle, but I don't know sysbase.


let $tablefound = 'N'

BEGIN-SELECT 
'x' 
  let $tablefound = 'Y'
FROM sysobjects 
WHERE name = 'Transaction_Table'
END-SELECT

if $tablefound = 'N'
  stop
end-if


-----Original Message-----
From: sqr-users-bounces+bstone=fastenal.com@sqrug.org
[mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org] On Behalf Of
Jay Sagadraca
Sent: Tuesday, April 25, 2006 4:48 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] if not exists (select * from sysobjects where name
='<>') = processing should stop

Hello Gurus,
   
       We have the following :
   
  SunOS 5.9 
  SQR version 6.2
  SYBASE_VERSION=12.5.0
   
       My problem is :
   
  begin-setup 
begin-sql on-error=stop 
if not exists (select 1 from sysobjects where name =
'Transaction_Table') 
 begin 
  raiserror 20004 "Table: Transaction_Table do not exist " 
 end 
end-sql 
begin-sql 
if exists ( select 1 from sysobjects where name = 'Clients') 
   begin
       print "Found the table ..."
      end
  end-sql 
end-setup 
   
  Begin-report 
End-report 
   
   
  I would like to abruptly stop the processing of the whole sqr if the
table is not on the sysobjects system table.  I tried this (above) but
it still goes to the next begin-sql and process it.  Is there another
way to do this or another command to force the sqr to totally stop the
processing if it didn't find the table?
   
  Thanks for the help.
   
        Jay Sagadraca


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users