Database Reference
In-Depth Information
FROM
application_settings_old
WHERE version =
app_version
AND
key='show_advertisements'),
show_splash_screen = (SELECT value
FROM
application_settings_old
WHERE version =
app_version
AND
key='show_splash_screen');
-- hand back the results to the caller
RETURN QUERY SELECT * FROM tmp_settings;
END;
$$ LANGUAGE plpgsql;
The previous function returns a single row of data to the calling query. The row con-
tains all of the settings that were previously defined as key/value pairs, but now are
explicitly defined fields. The function and the final table could also be enhanced to
transform the data types of the settings to something more explicit. But hey, I'm just
a lowly topic author, not a "real" developer, so I'll leave that one up to you.
Search WWH ::




Custom Search