[TIP] Comment you custom queries

Share business templates, ideas, experiences, etc with fellow Servoy developers here

[TIP] Comment you custom queries

Postby ngervasi » Thu Dec 09, 2010 8:57 pm

Very simple but useful hint: when you use custom queries, append a comment to the query, it will be useful when you will be debugging or profiling using the Servoy Admin Stats pages to figure out why that query is executed and when. The sintax to use is " -- Place your comment here".

Examples:

Code: Select all
SELECT sintpro_mods.sintpro_core_settings.default_mac_css, sintpro_mods.sintpro_core_settings.default_win_css, sintpro_mods.sintpro_core_settings.default_web_css FROM sintpro_mods.sintpro_core_settings ORDER BY sintpro_mods.sintpro_core_settings.sintpro_core_setting_id ASC -- CSS override

SELECT sintpro_mods.sintpro_users.sintpro_user_id, sintpro_mods.sintpro_users.flag_enabled, sintpro_mods.sintpro_groups.sintpro_group_id, sintpro_mods.sintpro_groups.flag_enabled, sintpro_mods.sintpro_groups.table_filters_switch, sintpro_mods.sintpro_databases.db_connection, sintpro_mods.sintpro_databases.database_name, sintpro_mods.sintpro_groups.id_ext_group, sintpro_mods.sintpro_databases.schema_name FROM sintpro_mods.sintpro_users INNER JOIN sintpro_mods.sintpro_groups ON sintpro_mods.sintpro_users.id_group = sintpro_mods.sintpro_groups.sintpro_group_id INNER JOIN sintpro_mods.sintpro_databases ON sintpro_mods.sintpro_groups.tenant_id = sintpro_mods.sintpro_databases.sintpro_database_id WHERE sintpro_mods.sintpro_users.sintpro_user_id = ? -- Framework init
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Return to Sharing Central

Who is online

Users browsing this forum: No registered users and 1 guest