All pastes #610361 Raw Edit

Someone

public sql v1 · immutable
·published 2007-07-09 12:44 UTC
rendered paste body
create procedure get_question_by_id(    IN question_id INT)BEGIN    SELECT        -- remember: this comes first to enforce PHP Object typing.		`question_type`.`description`,		`lang_ISO_639_3`.`Ref_Name`,		`lang_ISO_639_3`.`Id` as 'lang',		`question_definition`.`id`,		`question_definition`.`client_id`,		`question_definition_library`.`question_text`,		`question_definition_override`.`question_text` as `question_text_override`,		-- I am forced to retain this until PHP bug 39858 is resolved.        -- This is now totally deprecated by the question_definition_punch         -- table, and a software solution MUST be provided to get punch info        -- out of the question_definition_punch table.        --`question_definition_scale`.`scale_reverse`,		--`question_definition_scale`.`scale_max`,		--`question_definition_scale`.`scale_min`,		`question_format`.`id` as `data_type_id`,		`question_format`.`description` as `orientation`,		`question_definition`.`survey_id`,		`data_type`.`id` as `data_type_id`,		`data_type`.`description` as `data_type`	FROM		`question_definition` `question_definition` 			INNER JOIN `data_type` `data_type` 			ON `question_definition`.`data_type_id` = `data_type`.`id` 				INNER JOIN `question_format` `question_format` 				ON `question_definition`.`question_format_id` = `question_format`.				`id` 					INNER JOIN `question_type` `question_type` 					ON `question_definition`.`question_type_id` = `question_type`.					`id` 						LEFT OUTER JOIN `question_definition_override` 						`question_definition_override` 						ON `question_definition_override`.`question_id` = 						`question_definition`.`id` 							INNER JOIN `question_definition_library` 							`question_definition_library` 							ON `question_definition`.`question_library_id` = 							`question_definition_library`.`id` 								--LEFT OUTER JOIN `question_definition_scale` 								--`question_definition_scale` 								--ON `question_definition_scale`.`question_id` = 								--`question_definition`.`id` 									INNER JOIN `lang_ISO_639_3` `lang_ISO_639_3` 									ON `question_definition`.`lang` = 									`lang_ISO_639_3`.`Id`									    WHERE `question_definition`.`id` = question_id;ENDGO