I have ADODataSet
with the following query
DECLARE @ID_CONTRATO_EMPRESARIAL INTEGER = :ID_CONTRATO_EMPRESARIAL
BEGIN
WITH V1 AS (
select C.ID_CONTRATO,
COUNT(CASE AD.FUNCIONARIO WHEN 'TRUE' THEN 1 ELSE NULL END) FUNCIONARIOS,
COUNT(*) MEMBROS
FROM CONTRATO C, ADESAO AD
WHERE C.ID_CONTRATO_EMPRESARIAL = @ID_CONTRATO_EMPRESARIAL
AND C.ID_CONTRATO = AD.ID_CONTRATO
GROUP BY C.ID_CONTRATO, C.NUMERO, C.VALOR_CLIENTE)
SELECT
V1.FUNCIONARIOS, V1.MEMBROS,
PT.ID_PESSOA AS ID_PESSOA_TITULAR, PT.NOME AS NOME_TITULAR,
C.*
FROM V1, CONTRATO C, PESSOA PT
WHERE V1.ID_CONTRATO = C.ID_CONTRATO
AND C.ID_PESSOA = PT.ID_PESSOA
END
I would like to know if I can give a Edit
in this DataSet
and save the changed column in the database.
Basically what I'm trying to do is the following
dmContratoEmpresarial.cdsContratoEmpresarialContratos.Edit;
dmContratoEmpresarial.cdsContratoEmpresarialContratosVALOR_TI.Value := 1000;
dmFramework.Post(dmContratoEmpresarial.cdsContratoEmpresarialContratos);
Where the VALOR_TI
column is in the CONTRATO
table. But when checking the bank the column has not changed.