Hello Stellar.
I understand all your answers about macros created by the user.
As a matter of fact my problem is related to the predefined UniDAC macros.
I have changed my code using one of the options available for the tablename macro and the code still raises an exception at the EndUpdate method call.
It seems that the {timestamp } macro is not available in this version.
UnWork->SQL->BeginUpdate();
UnWork->SQL->Clear();
UnWork->SQL->Add("INSERT INTO HST2_OCORRENCIA \
(INICIO \
,ALARMEIN \
,TERMINO \
,DURACAO \
,ENVIOABERTURA \
,ENVIOFECHAMENTO \
,INTERVBUSCAINI \
,INTERVBUSCAFIM \
,BUSCAFALINF \
,BUSCAFALSUP \
,TRATAR \
,ENVIAREMAIL \
,MODULO_ID) \
VALUES \
({ timestamp '"+Ocorrencia.Inicio.FormatString("yyyy-mm-dd hh:nn:ss.zzz")+"'} \
,'"+Ocorrencia.AlarmeIN+"' \
,{ timestamp '"+Ocorrencia.Termino.FormatString("yyyy-mm-dd hh:nn:ss.zzz")+"'} \
,"+StringReplace(FloatToStrF(Ocorrencia.Duracao,ffFixed,10,2),",",".",TReplaceFlags()<<rfReplaceAll
)+" \
,{ timestamp '"+Ocorrencia.EnvioAbertura.FormatString("yyyy-mm-dd hh:nn:ss.zzz")+"'} \
,{ timestamp '"+Ocorrencia.EnvioFechamento.FormatString("yyyy-mm-dd hh:nn:ss.zzz")+"'} \
,{ timestamp '"+Ocorrencia.E3TimeStampIni.FormatString("yyyy-mm-dd hh:nn:ss.zzz")+"'} \
,{ timestamp '"+Ocorrencia.E3TimeStampFim.FormatString("yyyy-mm-dd hh:nn:ss.zzz")+"'} \
,"+StringReplace(FloatToStrF(Ocorrencia.E3LimFalInf,ffFixed,10,2),",",".",TReplaceFlags()<<rfReplaceAll
)+" \
,"+StringReplace(FloatToStrF(Ocorrencia.E3LimFalSup,ffFixed,10,2),",",".",TReplaceFlags()<<rfReplaceAll
)+" \
, '"+(Ocorrencia.Tratar ? "S" : "N") +"' \
,'"+(Ocorrencia.EnviarEmail ? "S" : "N") +"' \
,"+ IntToStr(Ocorrencia.ModuloId)+")");
}
UnWork->SQL->EndUpdate();
Please read carefully my post.
I can not afford an upgrade of UniDAC current version, and if the issue I am facing is a bug of the version I am using I would like a workaround to fix the issue.
Thank you very much.
Jayme Jeffman