Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I drop it?
Message
De
09/12/2013 08:01:02
 
 
À
06/12/2013 12:08:20
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01588891
Message ID:
01589547
Vues:
78
>>>But actually the alter table issue is related to the way Fox operates the long field names. It requires a dbc to maintain them. As long as you don't want to change them, the names are held in some internal structure in memory and all is fine. If you want to change the structure and have long names, you need a dbc and a simple cursor doesn't belong to one, hence it's a no go.
>>
>>That was my guess as well (albeit uneducated). See my earlier messages to Gregory/Peter
>>Which feeds my reluctance to create local cursors with those elegant one line sql statements even more.
>>Before it was just defensive instinct, this puts some reasoning behind it :)
>
>The inelegant would come into play when creating those output cursors anyway, and prefer to see them in one place, so I have the full inventory of the fields in one place, not the "whatever the cursor was passed plus or minus a few columns that I change now". If renaming into c(10) names is a part of that, so be it, it will be something like
>
>
select SufficientlyLongName as slong1
>   ,   sufficientlyLongSurname as slongSur
>
>etc etc, and even so I'd have the single place where to look up the meaning of those names. Alter table is, IMO, something designed as a tool for the DBA, and I use it extensively when maintaining the structure of the tables. Tables, not cursors. If you feel you should change the structure of your cursor, something's wrong (IOW, not Dragan compatible :) with how you create the cursor.
>
>We aren't walking the same side of the street, but I can hear you and I don't have to upper("shout") so you hear me as well, the street is not so wide.
>
>Here's the version of Frank Dietrich's intellisense script which I use whenever I have to make a select with more than a dozen fields, and need to change a few (delete lines, add lines, add aliases to fields):
>
*===========================================*
>*  FieldList Intellisense-Script            *
>*                                           *
>*  Copyright (c) 2002 All Rights Reserved.  *
>*  Frank Dietrich Datentechnik              *
>*  Leo-Baeck-Str. 22                        *
>*  14165 Berlin                             *
>*  PHONE :    +49-30-845 777-0              *
>*  FAX   :    +49-30-845 777-19             *
>*  CIS   :    100322,333                    *
>*  e-mail: frank.dietrich@dd-tech.de        *
>*  20.02.2002 v.1.0                         *
>*===========================================*
>
>*=======================================================*
>*  This Intellisense-script creates a comma-Delimited   *
>*  List of Fieldnames of any currently used Cursor.     *
>*  The list can contain no, real- (USER.NAME) or local  *
>*  aliases (A.NAME).                                    *
>*  Additionally an "AS"-clause can be added with the    *
>*  long field-Name (Caption) if the selected alias      *
>*  belongs to a database.                               *
>*=======================================================* 
>
>lparameters oFoxCode
>local lc_Alias, lc_Prefix, lc_List, ln_i, ln_WasSel
>local ll_LongName, lc_LongName, n
>
>lc_Alias = Inputbox("Select alias to get fields from?", "FieldList-Creator", alias())
>if empty(lc_Alias) or ! used(lc_Alias)
>	return oFoxcode.UserTyped
>endif
>		
>lc_List   = ""
>ln_WasSel = select()
>
>select (lc_Alias)
>
>n= fcount()
>for ln_i = 1 to n
>    	lc_List = lc_List +  space(8) + lower(field(ln_i) )
>    	if ln_i<> n
>		lc_List = lc_List + ",;"+chr(13)
>	endif
>endfor &&* ln_i = 1 to fcount()
>
>select (ln_WasSel)
>						
>oFoxCode.Valuetype =  "V"
>
>return lc_List
>
>I have versions of this with nvl(field, "") as field, without semicolons, with comma moved to precede the next line - which isn't too hard to add. It's just plain generated text anyway. So I just type "fieldlist" in an empty line, and I get a full list of fields. I only need to add Select before, and From... Into... where... after it.

Have you tried SuperBrowse which comes with Thor?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform