Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL VIEW and strange behavior
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00502658
Message ID:
00502819
Vues:
15
I really hate the nested syntax for joins that the view designer creates. I've also heard that even if used correctly, this syntax can yield different results from the syntax where you list the conditions for the joins sequentially. Although I don't see anything wrong with the code you posted, I'd try rearranging the join conditions as follows, to see if this works:
CREATE SQL VIEW "LV_STORAGE" AS ;
   SELECT Storage.iid, ;
          Storage.cdescrip, ;
          Storage.iprocessid,  ;
          Storage.nqueuingorder, ;
          Bizrules.iId AS "iBizRulesId", ;
          Bizrules.regla, ;
          Storage_queue.iStorageId, ;
          Storage_queue.ncapacity ;
   FROM ofertas!storage ;
      LEFT OUTER JOIN ofertas!storage_queue ;
          ON Storage.iid= Storage_queue.istorageid
      LEFT OUTER JOIN ofertas!bizrules ;
          ON Storage.iid = Bizrules.iid AND Bizrules.objecttype = "storage" ;
   WHERE Storage.iid = ?vp_storage


>Hello, firstable i use eview.app not view designer, now i want make 3 tables for 1 view, the strange behavior is when open for first time send me a error message: the column 'iid' not found, well here is the code:
>.
>CREATE SQL VIEW "LV_STORAGE" ;
> AS SELECT Storage.iid, Storage.cdescrip, Storage.iprocessid, Storage.nqueuingorder, Bizrules.iId AS "iBizRulesId",Bizrules.regla, Storage_queue.iStorageId,Storage_queue.ncapacity FROM ofertas!storage LEFT OUTER JOIN ofertas!storage_queue LEFT OUTER JOIN ofertas!bizrules ON Storage.iid = Bizrules.iid ON Storage.iid= Storage_queue.istorageid AND Bizrules.objecttype = "storage" WHERE Storage.iid = ?vp_storage
>
>BUT when remove LEFT OUTER JOIN for this code:
>
>CREATE SQL VIEW "LV_STORAGE" ;
> AS SELECT Storage.iid,Storage.cdescrip, Storage.iprocessid, Storage.nqueuingorder, Bizrules.iId AS "iBizRulesId",Bizrules.regla, Storage_queue.iStorageId,Storage_queue.ncapacity FROM ofertas!storage,ofertas!storage_queue ,ofertas!bizrules WHERE Storage.iid = Bizrules.iid AND Storage.iid= Storage_queue.istorageid AND Bizrules.objecttype = "storage" AND Storage.iid = ?vp_storage
>
>dont send me errors, but i dont have any line (because Storage_queue is empty), in the first SQL send me and error, but when i try again, works with one register, in the second case dont send me error but dont send me nothing
>
>i am lost, what i make wrong?
>
>thats the table strucs:
>
>table bizrules
>iid integer Key
>Objecttype character 10
>cdescrip character 20
>regla Memo
>
>table storage
>iid integer key
>cdescrip character 30
>iprocessid integer
>ncapacity n (2)
>nqueuigorder n(3)
>ibizrules integer
>
>
>table storage_queue
>istorageid integer
>ncapacity n(3)
>
>the main table is storage
>
>thanks in advance
>
>Francisco Morosini
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform