Request SQL with XTRA Valentina

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Apr 19 11:09:31 CDT 2004


On 4/19/04 11:01 AM, "maud crouzet" <tituyt at hotmail.com> wrote:

> With the Xtra valentina for Director,Could I reproduce this request ? Is it
> easy to adapte ?
> 
> 
> SELECT DISTINCT
>   p.ID_PRODUIT, p.NOM_PRODUIT, p.CODE_ACL,
>   f.L_FABRICANT, p.TAILLE, sc.ID_SOUS_CATEGORIE,
>   p.PRIX_PROD_EURO, fp.L_FORME_PROD, p.M_G_N,
>   p.ID_FABRICANT, c.L_CATEGORIE, p.DATE_PRODUIT,
>   psc.id_prod, psc.id_s_categorie
> FROM PRODUIT p INNER JOIN
>   FABRICANT f ON
>   p.ID_FABRICANT = f.ID_FABRICANT INNER JOIN
>   FORME_PROD fp ON
>   p.ID_FORME_PROD = fp.ID_FORME_PROD INNER JOIN
>   produit_sous_categorie psc ON
>   p.ID_PRODUIT = psc.id_prod INNER JOIN
>   SOUS_CATEGORIE sc INNER JOIN
>   CATEGORIE c ON sc.ID_CATEGORIE = c.ID_CATEGORIE ON
>   psc.id_s_categorie = sc.ID_SOUS_CATEGORIE INNER JOIN
>   PROPRIETE ON
>   p.ID_PRODUIT = PROPRIETE.ID_PRODUIT
> WHERE (psc.id_s_categorie =@ID_S_CAT) AND
>   (sc.ID_SOUS_CATEGORIE =@ID_S_CAT) AND
>   (p.ID_PRODUIT NOT IN
>       (SELECT id_produit
>         FROM propriete
>         WHERE   ( (id_pro_prod=8 ) and  id_valeur =30  or  id_valeur =29)
> ))
>         and ( p.ID_FABRICANT=@id_fab)
> ORDER BY f.L_FABRICANT, p.NOM_PRODUIT

Next,

You have several INNER JOINS, so in Valentina you get

FROM
    T1, T2, T3, T4
WHERE 
        T1.key = T2.ptr
  and
        T2.key = T3.ptr
  and     
        ...


-----------------
> WHERE (psc.id_s_categorie =@ID_S_CAT) AND
>   (sc.ID_SOUS_CATEGORIE =@ID_S_CAT) AND

I assume syntax @ID_S_CAT, means
    "insert value of variable ID_S_CAT"

In Director, you should self do concatenation of strings to get

    WHERE fld = 45
or
    WHERE fld = 'string value'


You see?


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list