4D's native SQL queries are a great way to retrieve field values without disturbing current records and selections. Despite SQL support appearing in 4D many years and versions ago, some developers still avoid SQL lookups in their day-to-day work. Amongst the reasons why developers steer clear of SQL queries is that changing tables and fields can break stored SQL statements without generating warnings or errors before deployment. Accompanying this technical note is a sample database with code that overcomes problems caused by deleting, renaming, or retyping structure elements. Additionally, the example includes a visual lookup code builder, dictionary, and validator. This technical note describes the sample implementation and explores various trade-offs and design choices contributing to the final code. Please adapt the example however suits your needs and style.
Download Complete Tech Note: Tech Note Document