temp_REGIONS{PROP:SQL}= 'Select * from

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’

Solution?

Solution is to declare unknown identifier.

Hoe do a declare TEMP_REGIONS so that it is not Unknown identifier?
Well Clarion does not know what this is although it was created in MySQL?

prop:sql is applied to FILE variables.

I remember now from the OLD days - create a dummy SQL file maybe with just one field?

See “TURBOSQL” in the help, there is an example.

could also be for VIEW right?

Yes, as I remember Clarion View

Not sure. I can’t find in the doc any note about VIEWs and PROP:SQL.

1 Like

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! :slight_smile:

1 Like

Thank you, found it!