Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disabling view designer - a little tip
Message
De
25/12/1999 10:21:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/12/1999 18:20:18
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00308463
Message ID:
00308547
Vues:
23
>I came across a situation where I created my view programmatically and it was performing just as I want. BUT whenever the "view designer" is used to modify it was screwed.
>Since I should protect usage of "view designer" for this particular views I had to find a way. Here is what I did :
>I included a dummy subquery :)
create sql view myView as ;
>  select ... from table1 left join table2 on .... ;
>      left join table3 on .... ;
>      where .... ;
>    <b>and table1.pk in (select pk from table1)</b>
This causes the designer to complain "SQL is too complex" and it doesn't open it at all. Query definition is left intact in DBC :)
>Of course for the sake of performance subquery could be made from a dummy one record table (iPK, cPK fields holding impossible values for integer and char generated PKs) :
>...where myTable.PK not in (select iPK from Dummy)
>Hope this helps to you too :)
>Cetin

I found another (and IMHO better) way of preventing the screw. Include a "FORCE" clause in your SQL (if applicable to your situation) :
create sql view myView as ;
  select ... from force table1 ;
     left join table2 ;
          on table1.id2 = table2.id ;
     left join table3 ;
          on table1.id3 = table3.id ;
     .... ;
     inner join table5 ;
          on table4.idx = lookup.id ;
     order by table1.somefield
This time designer complains saying "Not a character expression" and doesn't open the view :) Yet it works as it should :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform