View Single Post
  #1 (permalink)  
Old 05-14-09, 08:49
RNV RNV is offline
Registered User
 
Join Date: May 2009
Posts: 7
Unable to execute SP

Hi Friends,

I am new to informix so looking for your kind suggestion on my query.
I want to execute below written SP but it is throwing Syntax Error . Can anyone suggest me what is the possible cause of error here. Any advice will be much appreciated.

PHP Code:
Create procedure MSA_div_re_sp();                    
                                                     
DEFINE i INTEGER;                                    
DEFINE x INTEGER;                                    
DEFINE clid char(8);                                 
DEFINE symb char(7);                                
                                                     
select unique cl_id,symbol                           
        from penltxns                                
        where set_no
="44"                            
        
and cl_id not like "%-%" INTO TEMP temp_long;
                                                     
select count(*) into i from temp_long;               
                                                     
while(
>=1)                                         
select first 1 cl_id into clid from temp_long;          
select first 1 symbol into symb from temp_long;         
                                                     
select unique cl_id[8,12from holdings              
      where holdings
.cl_id[1,7] = clid               
      
and symbol symb
            
and cl_id not like "%-00"                  
      
and cl_id not like "%-PH"                  
      
and cl_id not like "%-RJ" into TEMP t_long;
                                                 
select count(*) into x from t_long;              
                                                 
If (
== 1)                                      
THEN                                             
select penltxns
.cl_id[8,12]                      
        
from penltxns                    
        where penltxns
.cl_id[1,7]= clid          
        
and penltxns.symbolsymb                
        
and penltxns.cl_id not like "%-%"        
        
and penltxns.set_no "44"               
        
and penltxns.can_date "12/31/1899";    
END IF                                           
DELETE from temp_long                            
where cl_id
=clid                                 
and symbol=symb;                                 
                                                 
DROP TABLE t_long;   
END WHILE     
              
END PROCEDURE 
Thnx,
Raj

Last edited by RNV; 05-21-09 at 06:03. Reason: changing title
Reply With Quote