• 고객센터
  • 교육
  • 매뉴얼
  • 데모
  • 제품소개
안용근
조회 수 : 3861
2005.08.26 (00:02:34)
게시판을 이용해 주셔서 감사합니다.
다음양식에 맞게 입력해주세요.

* 고객시스템명 :
* TOInB 버전 : 5.0
* 서버 Platform : 2000 Server
* 문의 유형(질문/요청/참조) : 질문
* 내용 :
토인비 SOB EVENT에서 token을 여러번 반복해서 사용할 수 없나여?
꼭 가르쳐주세여...
예로...

char temp_sql1[100];
        memset(temp_sql1,0,100);

        char *token01;
        char *token02;
        char *token03;
        char *token04;
        char *Temp01[5];
        char *Temp02[5];
        char *Temp03[5];
        char *Temp04[5];
        int count1, count2, count3, count4;
        int i = 0;
        char seps_again[]   = ",\n";

token01 = strtok(GUBUN1_again, seps_again);
                                
                count1=0;
        
        while( token01 != NULL)
            {
              // While there are tokens in "string"
               Temp01[count4]=token01;                   
                   token01 = strtok( NULL, seps_again );
                  
                   count1++;
            }
            
                token02 = strtok(TXTLABEL_again, seps_again);
                
                count2=0;
        while( token02 != NULL)
            {
              // While there are tokens in "string"                                
                   Temp02[count1]=token02;
                   token02 = strtok( NULL, seps_again );
                  
                   count2++;
            }
                
                token03 = strtok(TXTVALUE_again, seps_again);
                
                count3=0;
        while( token03 != NULL)
            {
              // While there are tokens in "string"
                                           
                   Temp03[count2]=token03;
                   token03 = strtok( NULL, seps_again );
                                     
                   count3++;
            }
            
                token04 = strtok(LDOMAIN1_again, seps_again);
                
                count4=0;
        while( token04 != NULL)
            {
              // While there are tokens in "string"                                  
                   Temp04[count3]=token04;
                   token04 = strtok( NULL, seps_again );
                  
                   count4++;
            }
            for(i=0; i<count2; i++)
            {            
                        if (!strcmp(Temp01[i],"N") && strcmp(Temp03[i],""))
                        {
                                // GUBUN1 = none 인경우 검색쿼리 조립
                                strcat(select_sql, "AND        A.");
                                sprintf(temp_sql1,"%s", Temp02[i]);
                                strcat(select_sql,temp_sql1);
                                strcat(select_sql," LIKE ");
                                                
                                sprintf(temp_sql1, "'%%%s%%'        ",Temp03[i]);
                                strcat(select_sql, temp_sql1);
                        }
                        else if (!strcmp(Temp01[i],"A") && strcmp(Temp03[i],""))
                        {
                                // GUBUN1 = A 인경우 검색쿼리 조립
                                sprintf(temp_sql1, "AND L.LDOMAIN = %s ", Temp04[i]);
                                strcat(select_sql, temp_sql1);
                
                                sprintf(temp_sql1, "AND A.%s = L.DOMAINVALUE        ", Temp02[i]);
                                strcat(select_sql, temp_sql1);
                
                                sprintf(temp_sql1, "AND        L.DOMAINDESC LIKE '%%%s%%'         ", Temp03[i]);
                                strcat(select_sql, temp_sql1);
                        }                  
                }
        }
        else
        {
                if (!strcmp(GUBUN1,"N") && strcmp(TXTVALUE,""))
                {
                        // GUBUN1 = none 인경우 검색쿼리 조립
                        strcat(select_sql, "AND        A");
                        sprintf(temp_sql1,".%s", TXTLABEL);
                        strcat(select_sql,temp_sql1);
                        strcat(select_sql," LIKE ");
                                        
                        sprintf(temp_sql1, "'%%%s%%'        ",TXTVALUE);
                        strcat(select_sql, temp_sql1);
                }
                else if (!strcmp(GUBUN1,"A") && strcmp(TXTVALUE,""))
                {
                        // GUBUN1 = A 인경우 검색쿼리 조립
                        sprintf(temp_sql1, "AND L.LDOMAIN = %s ", LDOMAIN1);
                        strcat(select_sql, temp_sql1);
        
                        sprintf(temp_sql1, "AND A.%s = L.DOMAINVALUE        ", TXTLABEL);
                        strcat(select_sql, temp_sql1);
        
                        sprintf(temp_sql1, "AND        L.DOMAINDESC LIKE '%%%s%%'         ", TXTVALUE);
                        strcat(select_sql, temp_sql1);
                }
        }
 
Tag List
XE Login