CURSOR c
IS
SELECT COMPANYID,
GROUPID,
PERIODID,
FN_PPROCESSCURRENT
FROM LIQUIDATIONSDETAILS
WHERE PROCESSID = FN_PPROCESSPREVIOUS
AND (UNCOLLECTED > 0 OR INVOICE = 0)
AND (((GROUPID = vgroupid) AND (vgroupid > -1)) OR (vgroupid = -1))
par exemple :si vgroupid = -1
, alors la dernière condition sera (((GROUPID = -1) AND (-1 > -1)) OR (-1 = -1))
ou ((forever_false AND forever_false) OR (forever_true))
ou (-1 = -1)
- tous les enregistrements
à la place, si vgroupid = 123
la dernière condition sera (((GROUPID = 123) AND (123 > -1)) OR (123 = -1))
ou (((GROUPID = 123) and forever_true) OR (forever_false))
ou (GROUPID = 123)
- seulement 123 GROUPID