Note, there were also API's and class libraries which do it similar to PHP. Often those tools can generate C/C++ code directly from the table definition of the data source. Then you only would need to provide the select statement.