rc = SQLExecute(odbcc->hstmt); if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt); return W_ERROR; }
int execute_admin_request(struct odbc_context_t *odbcc, union odbc_data_t *odbcd){	SQLRETURN rc;	int j;	/* Perpare statement for Admin Request interaction. */	rc = SQLPrepare(odbcc->hstmt, STMT_ADMIN_REQUEST, SQL_NTS);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	/* Bind variables for Admin Request interaction. */	j = 1;	rc = SQLBindParameter(odbcc->hstmt,		j++, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER, 0, 0,		&odbcd->admin_request_odbc_data.eb.i_id, 0, NULL);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	rc = SQLBindParameter(odbcc->hstmt,		j++, SQL_PARAM_OUTPUT, SQL_C_DOUBLE, SQL_DOUBLE, 0, 0,		&odbcd->admin_request_odbc_data.eb.i_srp, 0, NULL);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	rc = SQLBindParameter(odbcc->hstmt,		j++, SQL_PARAM_OUTPUT, SQL_C_DOUBLE, SQL_DOUBLE, 0, 0,		&odbcd->admin_request_odbc_data.eb.i_cost, 0, NULL);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	rc = SQLBindParameter(odbcc->hstmt,		j++, SQL_PARAM_OUTPUT, SQL_C_CHAR, SQL_VARCHAR,		0, 0, odbcd->admin_request_odbc_data.eb.i_title,		sizeof(odbcd->admin_request_odbc_data.eb.i_title), NULL);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	rc = SQLBindParameter(odbcc->hstmt,		j++, SQL_PARAM_OUTPUT, SQL_C_ULONG, SQL_INTEGER, 0, 0,		&odbcd->admin_request_odbc_data.eb.i_image, 0, NULL);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	rc = SQLBindParameter(odbcc->hstmt,		j++, SQL_PARAM_OUTPUT, SQL_C_ULONG, SQL_INTEGER, 0, 0,		&odbcd->admin_request_odbc_data.eb.i_thumbnail, 0, NULL);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	rc = SQLBindParameter(odbcc->hstmt,		j++, SQL_PARAM_OUTPUT, SQL_C_CHAR, SQL_VARCHAR, 0, 0,		odbcd->admin_request_odbc_data.eb.a_fname,		sizeof(odbcd->admin_request_odbc_data.eb.a_fname), NULL);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	rc = SQLBindParameter(odbcc->hstmt,		j++, SQL_PARAM_OUTPUT, SQL_C_CHAR, SQL_VARCHAR, 0, 0,		odbcd->admin_request_odbc_data.eb.a_lname,		sizeof(odbcd->admin_request_odbc_data.eb.a_lname), NULL);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);#ifndef AUTOCOMMIT_OFF		return W_ERROR;#endif	}#ifdef AUTOCOMMIT_OFF	if (rc == SQL_SUCCESS)	{		/* Commit. */		rc = SQLEndTran(SQL_HANDLE_DBC, odbcc->hdbc, SQL_COMMIT);	}	else	{		/* Rollback. */		rc = SQLEndTran(SQL_HANDLE_DBC, odbcc->hdbc, SQL_ROLLBACK);	}	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_DBC, odbcc->hdbc);		return W_ERROR;	}#endif	/* Execute stored procedure. */	rc = SQLExecute(odbcc->hstmt);	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)	{		LOG_ODBC_ERROR(SQL_HANDLE_STMT, odbcc->hstmt);		return W_ERROR;	}	return OK;}