Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Command contains unrecog phrase/keyword on SQL
Message
 
 
À
10/01/2009 12:45:11
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01372085
Message ID:
01372558
Vues:
28
I don't see how it's better but it's definitely harder to read.

>Eagle eyed? Yeah, right... it's just an illusion. I've spotted it right away simply because the same thing bit me dozens of times. Which is why I use Fabio's syntax, which is far easier:
>
>
select field1;
>   ,   field2 ;
>   ,   field3 ;
>   ,   field4 ;
>   ,   field5 ;
>...
>
>The trouble with SQL syntax is that for 100 fields you have 99 commas. And you need to take care to omit the last one - and the end of the field list is the place where you're most likely to add stuff, so you have to take that care each time, and of course you'll forget once in a while. And since it doesn't happen every day, when it happens, you don't remember what it is.
>
>I like Fabio's syntax because the oddball field (without the comma) is the first one, but it somehow balances out by having the word "select" to it. And since it's the first field, it's very unlikely it will ever change. The rest of the fields may, at any time. I've also found that this way I can copy and paste fields from one SQL statement to another with far more ease (because I copy whole lines, and don't have to remember whether I started from a comma or from the space after the comma or from the first character of my fields, and likewise - how far did I select to copy). Of course, if I add more lines from elsewhere, I don't have to check for that last comma, because it simply isn't there.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform