Documentation

NextID

For use with the Oracle version only!

int
CDatabase::NextID(
 string sequence_name
)

The method returns the next value from the sequence_name. Non-static method.

Parameters

ParameterDescription
sequence_name Name of a sequence.

See Also

Examples of use

<?
function AddResultAnswer($arFields)
{
	$err_mess = (CForm::err_mess())."<br>Function: AddResultAnswer<br>Line: ";
	global $DB;
	$arBinds = array();
	$arInsert = $DB->PrepareInsert("b_form_result_answer", $arFields, "form");
	$AID = $DB->NextID("sq_b_form_result_answer");
	$strSql="INS ERT IN TO b_form_result_answer (ID,".$arInsert[0].") VALUES ($AID,".$arInsert[1].")";
	if (is_set($arFields, "USER_TEXT")) 
		$arBinds["USER_TEXT"] = $arFields["USER_TEXT"];
	if (is_set($arFields, "ANSWER_TEXT_SEARCH")) 
		$arBinds["ANSWER_TEXT_SEARCH"] = $arFields["ANSWER_TEXT_SEARCH"];
	if (is_set($arFields, "ANSWER_VALUE_SEARCH"))
		$arBinds["ANSWER_VALUE_SEARCH"] = $arFields["ANSWER_VALUE_SEARCH"];
	if (is_set($arFields, "USER_TEXT_SEARCH"))
		$arBinds["USER_TEXT_SEARCH"] = $arFields["USER_TEXT_SEARCH"];
	$DB->QueryBind($strSql, $arBinds);
	return $AID;
}
?>


© «Bitrix24», 2001-2024
Up