When there is a table that is part of a database (DBSTAFF) I can browse it
and it automatically opens the database and shows the long field names as
headers. When I do a "select * from DBSTAFF" I get a cursor with the long
field names as headers. My question is "What syntax do I use specify
specific field names if I don't want them all?
Joe,
** Completely Untested Pseudo-Code **
It's probably going to be something like this, using an in-line UDF
in the query:
SELECT GetRealFieldNameFor("MyTable","My Long Field Name") AS
LongName1, GetRealFieldNameFor("MyTable","My Other Long Field Name")
AS Longname2 FROM MyTable INTO CURSOR Whatever
FUNCTION GetRealFieldNameFor(cTable,cFieldName)
LOCAL therow, thereturn
therow = 0
thereturn = ""
* Get an array of long names and short names for fields.
ASOMEUSEFULDBCARRAYFUNCTION(aMyArray,parms)
therow = ASCAN(aMyArray,cFieldName,-1.-1.[whatever column),15)
IF therow > 0
thereturn = aMyArray(therow,[whatever column])
ELSE
* Massive problem that will hose your query in an un-fixable manner.
ENDIF
RETURN thereturn
ENDFUNC
This is NOT TESTED. It would probably take a couple hours to figure
it out completely. The other suggestions people have made regarding
querying the properties of a database should get you there.
It's probably going to be waaaaaay sllooooow...
And, of course, it will only work in VFP SQL.
You are better off constructing a data dictionary table in advance
and pulling the translations from it to build your query expressions.
Ken Dibble
www.stic-cil.org
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/E2.71.06528.BD21F255@cdptpa-oedge03
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.