Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OpenTables() freezes client computers opening views
Message
De
22/08/2001 16:28:20
 
 
À
22/08/2001 11:30:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00546445
Message ID:
00547611
Vues:
9
>I have run some SQL statements that are less than 1000 characters. These I execute as a macro , ie
>cSQL = "create SQL view as select * from specs .... etc"
>&cSQL
>
>- this works in all cases.
>
>So the problem is when I text to file, compile the file and run it.

Hmm... if your goal is to run a long CREATE SQL VIEW statement I'm not sure why you're writing it out to a separate .PRG in the first place.

Some things you might try instead:

- this is really basic, but I've got to ask: you *do* know about the use of * in SELECT - SQL e.g.
SELECT ;
  * ;
  FROM MyTable...

* or, for multiple tables you can get * from just those that are needed:
SELECT ;
  Spec.*, ;
  ...some other columns from other tables...
  FROM Spec, OtherTables...
- use the alias clause for tables in the join. This can shorten the string length:
SELECT ;
  A.Col1, ;
  A.Col2, ;
  ... ;
  FROM Spec A ;
  ...
Another thing you can do is use macro expansion for individual clauses in SELECT, rather than for the whole thing:
SELECT ;
  &lcColumnExpression ;
  FROM &lcJoinExpression ;
  WHERE &lcWhereExpression ;
  ORDER BY &lcOrderByExpression ;
  ...
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform