Gurus and Gurettes:
My greatest coding challenge remains the use of ampersand variables. I
get the concept, but my execution ... hoo boy.
So here's what works:
SELECT (MIN(cpoDate)) INTO vdateStart INDIC vind1 +
FROM cpoHeader WHERE (IYR4(cpoDate)) = .vyearStart
But I need to sub-out the table name, and column name 'cpoDate' with the
likes of 'invDate', 'shipDate', etc.
This does the trick for the column name:
SET VAR vcol_date TEXT = 'cpoDate'
SET VAR vamp_dateCol_min TEXT = '(MIN(&vcol_date))'
SET VAR vamp_dateCol_iyr4 TEXT = '(IYR4(&vcol_date))'
SELECT &vamp_dateCol_min INTO vfts_dateStart INDICATOR vind1 +
FROM cpoHeader WHERE &vamp_dateCol_iyr4 = .vyearStart
... but only so long as the literal tablename 'cpoHeader' is included in
the FROM clause.
This returns a syntax error:
SET VAR vtableName TEXT = 'cpoHeader'
SELECT ... FROM .vtableName ...
... as does this:
SET VAR vtableName TEXT = 'cpoHeader'
SELECT ... FROM &vtableName ...
... as does this:
SET VAR vtableName TEXT = 'cpoHeader'
SET VAR vamp_from_tablename TEXT = 'FROM .vtableName'
SELECT ... &vamp_from_tableName ...
... as does this
SET VAR vtableName TEXT = 'cpoHeader'
SET VAR vamp_from_tablename TEXT = 'FROM &vtableName'
SELECT ... &vamp_from_tableName ...
Clearly, I'm flailing. Any assistance much appreciated!
Bruce
Bruce A. Chitiea | SafeSectors, Inc.
112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
[email protected] | +011 (909) 238-9012 c | +011 (909) 912-8678 f
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/emefc63529-209a-44f7-a4c9-390b1f709fa9%40pathfinder.