Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 18 Aug 2010 @ 11:38:33 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: .IF ..THEN statement
 
From:   sathyanarayana.x.pothu

Hi,

  1. What is the difference between .Quit and .Quit 0 and .Quit 99?  


.Quit is to come out from the session.

.Quit 0 is to come out from the session with a return code of zero. Return code 0 is used for a successful case. It will be more useful in scripts as we might be interested to execute some more stuff based on if the previous step returns a zero.

.Quit 99 is to come out from the session with a return code of 99. I think the return codes are depends on the coding conventions.


  2. Are the expressions '.IF ERRORCODE<> 0' and '.IF ACTIVITYCOUNT > 0' same? Can I use them interchangeably?  


No.

Successful execution of SQL gives the errorcode zero. '.IF ERRORCODE<> 0' catches non-successful cases and often helps in identifying syntax errors (such as 3706 error).

'ACTIVITYCOUNT' is the count of number of rows processed in the previous SQL. For example if you expect a 0 rows from a select SQL, you might put a condition such as .if activitycount <> 0 then .quit 8

Hope this helps.


Best Regards,

Satya



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023