How to use DELCASE function to delete many cases in the csdb file ?

Discussions about CSEntry
mosbi
Posts: 17
Joined: April 8th, 2021, 4:13 am

Re: How to use DELCASE function to delete many cases in the csdb file ?

Post by mosbi » January 22nd, 2022, 3:14 pm

Oh okay!!!
Your analysis actually drew my attention to some point in my program: to answer you point by point:
for problem #1: concerning the key ID1 to IDN that must be passed as a parameter of the DELCASE function, the fact that I have used the expression key(CAISSE_VILLAGEOISE) sends me back the entire chain of IDs completely at each turn of loop, so the problem is not at this level.
for problem #2: I agree
for problem #3: indeed this is where the problem was! in your comment in this paragraph you asked to know if I modified the CaisseVillageoise.csdb file in another application? so no!
In fact in the principle of my global application, there is a step where I must change the value of one of the keys of the identification chain before the DELCASE step. and it is therefore this change that I made with this script:
CODE: SELECT ALL

Code: Select all

forcase CAISSE_VILLAGEOISE WHERE C24=codeLogin do
	id_case=uuid(CAISSE_VILLAGEOISE);
	resultat_req=sqlquery(CAISSE_VILLAGEOISE,'UPDATE "main"."level-1" SET "C67"=3 WHERE "level-1"."case-id"= "' + id_case + '"');
endfor
;
which modified the value of variable C67.
According to your statements, I understood that this modification did not modify the value of the C67 variable in the tree structure, that is to say at the source in depth, hence the discrepancy in the key chains.
For example, the key string from a case can be: CDC001422223113211642830461
my update script turns it to CDC001423223113211642830461
and when I call the expression key(CAISSE_VILLAGEOISE) it returns me the updated value, i.e. CDC001423223113211642830461
However the DELCASE does not find the case because it is the string CDC001422223113211642830461 which is still considered in the tree structure. so i understand where the problem is.

So, to allow other forum members to understand and follow the topics, I declare this topic resolved and I will open another topic so that we can discuss how to modify the value of a key in an identification string without duplicating the case as the writecase function does!

your explanations helped to know where my problem came from.
Thank you

Post Reply