Source
result = zbx_db_select("select a.clock,a.alerttype,a.status,mt.name,a.sendto,a.error,a.esc_step,a.userid,a.message"
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/******************************************************************************
* *
* Purpose: request proxy field value by proxyid. *
* *
* Return value: upon successful completion return SUCCEED *
* otherwise FAIL *
* *
******************************************************************************/
int expr_db_get_proxy_value(zbx_uint64_t proxyid, char **replace_to, const char *field_name)
{
zbx_db_result_t result;
zbx_db_row_t row;
int ret = FAIL;
result = zbx_db_select(
"select %s"
" from proxy"
" where proxyid=" ZBX_FS_UI64,
field_name, proxyid);
if (NULL != (row = zbx_db_fetch(result)))
{
*replace_to = zbx_strdup(*replace_to, row[0]);
ret = SUCCEED;
}
zbx_db_free_result(result);
return ret;
}
/******************************************************************************
* *