Combining (One Row) Parameter Tables

Applications often have single row tables to store things like app or user parameters. A common method to ensure the table only has one record is to set up a numeric field (perhaps “ParamID” as type Long) and set as the Primary Key. Set the Default Value for the table to 0, the Validation Rule for that field to =0 and set some Validation Text such as “Only one record allowed in this table.”

If the app has both an AppParam table for general settings and a UserParam table for user-specific setting you could combine them as one row in a query by creating a temporary field in the query that is only used to join the two tables together.


SELECT sp.*, up.* 
FROM 
(
  ( SELECT *, "A" as addedField FROM SysParam)  AS sp
  INNER JOIN 
  ( SELECT *, "A" as addedField FROM UserParam) AS up
  ON sp.addedField = up.addedField
)