Applies to: no Clarion or server version is named in the thread.
Problem
The poster needed a fixed set of data (a code and a description) from a table in database B while his application used database A. The underlying table definition might change, and the data was read-only. He asked whether a SQL view was the best way.
Solution
Three answers were given, none disputed:
- Create a SQL VIEW on the server. Tim P. called it an excellent tool for standard access to a table that may change structurally.
- Issue a dynamic SQL query into a generic table of your own. Declare a table with two STRING(100) fields, set PROP:SQL to the SELECT of the two columns, then loop with NEXT and read the two fields until ERRORCODE() is set. Robert P. wrote that this works however much the server definition changes.
- Use a Clarion VIEW with BUFFER, for example
buffer( myview, 30, 2,2, 150), so the server does the looping and Clarion does not loop slowly (Ben's reply; the thread does not explain the BUFFER values).
Tim P. also pointed to Dan Pressnell's "Better SQL" articles on icetips.com.
Caveats
- The poster said he would look at the suggestions; he did not report which one he used.
- The sample in answer 2 was posted with an unclosed quote in the SELECT string; close it when you copy.
- With answer 2 the field names no longer match the server; only the column order of the SELECT matters.
Today (2026)
The three approaches are plain Clarion and SQL and likely still hold; not re-tested here.
Sources: Paul M. (Feb 2008, the question), Tim P., Robert P., Ben R. (Feb 2008) in softvelocity.clarion.databasedrivers.