Avoiding Placeholder Models

One of the fields in the model schema is called mflag and this is used to indicate that this particular model record is of a special type. Mostly this is used for things like favourite lists and is pretty unimportant to the selection process - the exception to this is if this field has the value P which stands for placeholder.

As you would guess from the name, Placeholder model records are not normally to be displayed - they exist to be a convenience on which to hang download and association records or to allow records to be added for new models prior to the release of any of their sets. It is therefore normal to create your SQL queries that select model records so that they explicitly do not select placeholder models.

The following SQL code segment that goes in the where clause of the SQL query will do the correct selection:

( mflag != 'P' or mflag is null )

As an example, if you were selecting all Blonde haired models you would write a query like this to get the valid models you want shown:

select modelno, mname, mflag, mrating 
from models
where mhair = 'Blonde' and ( mflag != 'P' or mflag is null )
order by mname