0 Replies Latest reply on Jul 31, 2002 10:08 AM by 316330

    regroup a lot of small sql request

    316330
      hello
      I'am developping a server in c
      This server connects to a database
      I use oo4o for the connection
      But I have I problem because I have a lot of small request like that

      select cdf_nom
      from cdf_codif, fitty_typeinteraction
      where
           fitty_fit_code_fk_pk like '183'
           and fitty_cdf_type_code_fk_pk = cdf_code_pk
           and cdf_numero_pk like 'IY'

      All works ok but the application is too slow because I have a function in c by request like that


           strcpy(sqls,"select cdf_nom");
           strcat(sqls," from splab_specialite_labo, cdf_codif");
           strcat(sqls," where");
           strcat(sqls," splab_sp_code_fk_pk like '");
           strcat(sqls,idLabo);
           strcat(sqls,"' ");
           strcat(sqls," and splab_cdf_lab_code_fk_pk = cdf_code_pk");
           strcat(sqls," and cdf_numero_pk like '15'");
           
           /* execute la requete */
           requete.Open(*databb,sqls);


           while (!requete.IsEOF())
           {
                /* balise statutLabo */
                requete.GetFieldValue("cdf_nom", statutLabo,TAILLE_CDF_NOM);
                if (strlen(statutLabo) != 0)
                {
                     bstrValue = AsciiToBSTR(statutLabo);
                     if (!bstrValue)
                     {
                          ERROR1("Theriaque : AsciiToBSTR function failed");
                          goto shutdown ;
                     }
                     cleanAllString(bstrValue);
                     elementNode = requestDoc->CreateNode(NODE_ELEMENT, V_StatutLabo, rootRequestNode, bstrValue);
                     if (!elementNode)
                     {
                          ERROR1("Theriaque : creation of element node failed");
                          goto shutdown ;
                     }
                     SAFERELEASE(elementNode);
                     if (bstrValue) SysFreeString(bstrValue);
                     bstrValue = NULL ;
                }


                requete.MoveNext();
           }

      I would like to know how to optimise it but I can't regroup all the small request in a big requestbecause it's to slow
      If it's possible a pl/sql bloc it's will be great