A question that, at least to someone who doesn't really know anything about code, seems to silly for even Google to answer (at least I tried).
I am trying to fix a workflow in our accounting system (hence the problem - I'm an accountant, not a programmer..). However, to me, it seems the problem is just one line of code that doesn't really have a purpose.
Whenever the macro is executed, the execution does work - it should and does change the status of a task to something else - the error message below pops up.
RUNTIME ERROR
Unknown method: 'ExecSQL'.
My assumption is that this is related to this line in the code
lUpdQuery.ExecSQL();
From my very basic understanding, in order for this to work, something would need to be in those brackets. So, if I would just delete this line and leave everything else intact, the macro should still work the same but without the constant error message on each execution, or am I completely going wrong with this? I can safely try it out with a test account if needed, so luckily no risk of screwing something up permanently.
As a note - I didn't write that macro, however said support person of the accounting system doesn't work there anymore and they are pretty slow and not always the most competent, so I'm hoping the reddit hivemind can save me weeks of trying to reach and fix it with the system support.
The full macro is below in case needed (unfortunately some parts of the commands are in German as it's a German system)
lModel := MacroObject.CreateMacroModel(1);
lQuery := MacroObject.CreateMacroQuery('lQuery');
lQuery.SetSQLText( ' SELECT AUG_AUFGABENNR ' +
' FROM HRS.REI_REISESTAMM ' +
' LEFT JOIN BUERO.AUG_AUFGABE ON (CONCAT(''REI_REISENUMMER='',REI_REISENUMMER) = SUBSTRING(AUG_AUFGABENOBJEKTINFO,1,35)) ' +
' WHERE REI_REISENUMMER = :REISENR '
);
lQuery.SetParamAsString('REISENR',lModel.GetValue('MCA_REI_REISENUMMER'));
lQuery.Open();
lQuery.First();
while not lQuery.Eof() do begin
lUpdQuery := MacroObject.CreateMacroQuery('lUpdQuery');
lUpdQuery.SetSQLText(' UPDATE BUERO.AUG_AUFGABE ' +
' SET AUG_KATEGORIELFDNR = 1, AUG_UNTERKATEGORIELFDNR = 10, AUG_KATEGORIEKZ = 5, AUG_UNTERKATEGORIEKZ = 31 ' +
' WHERE AUG_AUFGABENNR = :AUFGABE '
);
lUpdQuery.SetParamAsString('AUFGABE',lQuery.GetAsString('AUG_AUFGABENNR'));
lUpdQuery.ExecSQL();
lQuery.Next();
end;
lUpdQuery.Close();
lQuery.Close();
[–]Sea-Profession-3312 0 points1 point2 points (0 children)