regionslookup{PROP:SQL}= ‘CREATE TEMPORARY TABLE IF NOT EXISTS temp_REGIONS LIKE REGIONS’
This does create the table, I can see it in Navicat .
The next line causes compile error
Unknown identifier: TEMP_REGIONS
temp_REGIONS{PROP:SQL}= ‘Select * from regions where Printable=1 order by sortorder’
Interesting, I checked also and agree it is not specifically mentioned. How weird!
Regardless, I often do MyView{PROP:SQL} = 'SELECT ...' and it works quite well.
Digging into the help further I do see this usage implied in the “Using Embedded SQL” topic:
Note: When you issue a SELECT statement using PROP:SQL, the selected fields must match the fields declared in the named file or view. In addition, if you use VIEW{Prop:SQL} to issue a SELECT statement, the fields in the SELECT must be ordered based on the field order in the file definition, not the PROJECT sequence.
Which is indeed very important!
That topic also goes on to mention PROP:SQLFilter however, before you dig into that you may also want to review the “SQL (use SQL code)” topic in the help and for yet further studies, look into PROP:Alias a bit too!