Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I build that SQL
Message
 
To
16/03/2005 15:03:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00996490
Message ID:
00996496
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
The other way that comes to my mind is to build a UDF, because If You have a code like this:

020101 SubSub1 previous SELECTs doesn't work:
SELECT PADR(MyFunc(MyTable.Code)) AS Decription .....


FUNCTION MyFunc(cString)
  LOCAL ret_val, seek_val
  ret_val = ""
  seek_val = ""
  DO WHILE .NOT. EMPTY(cString)
     seek_val = seek_val + LEFT(cString,2)
     cString = SUBSTR(cString,3)
     SEEK seek_val IN MyTable ORDER MyTableOrderByCode
     ret_val = ret_val + " " + ALLTRIM(Description)
  ENDDO
RETURN ALLTRIM(ret_val)
but it isn't so fast way
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform