4GL以输入的顺序排序显示

#以输入的顺序排序显示(输入什么顺序就显示什么顺序)
LET l_wc=tm.wc
  
SELECT instr(l_wc,'sfb01 in',1,1) INTO l_have FROM dual 
  
IF l_have <> 0 THEN
     
    SELECT instr(l_wc,'sfb01 in',1,1) INTO l_n1 FROM dual        
    
    SELECT instr(l_wc,'(',l_n1,1) INTO l_n2 FROM dual
    
    SELECT instr(l_wc,')',l_n2,1) INTO l_n3 FROM dual   
    
    LET j=1
    
    LET k=1
    
    LET l_orderby=" order by case sfb01"
    
    FOR i=l_n2 TO l_n3 
    
      IF l_n4 < l_n3 THEN
      
         SELECT instr(l_wc,'\'',l_n2,j) INTO l_n4 FROM dual
      
         SELECT instr(l_wc,'\'',l_n2,j+1) INTO l_n5 FROM dual
        
       IF l_n4 > 0 AND l_n5 > 0 THEN       
           
          LET l_orderby=l_orderby," when '",l_wc[l_n4+1,l_n5-1],"' then ",k CLIPPED," "
           
          LET k=k+1
           
          LET j=j+2
        
       ELSE
           
          EXIT FOR
        
       END IF
    
      ELSE
    	  
       EXIT FOR
    
      END IF
    
   END FOR
        
   LET l_orderby=l_orderby," end "
    
   LET l_sql=l_sql CLIPPED,l_orderby CLIPPED
  
END IF


 

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yiruai/article/details/53994097
个人分类: ERP(TIPTOP)
上一篇TIPTOP使用技巧(二)
下一篇webservie服务重启以及查看LOG档
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭