Simplicty and flexibility!


MemoExecDQL


Started by Rainer
Search
You will need to Sign In to be able to add or comment on the forum!

MemoExecDQL

I have trouble starting a memoExecDQL out of a memoExecDQL using "global" 

define global "Belegnr" Numeric String 6.

define global "Belegnr2" Numeric String 2.

assign global Belegnr := data-entry Field1 .

assign global Belegnr2 := data-entry Field2 .

retval:=MemoExecDQL(any DQL with DQLnr=0006 DQL,global Belegnr,global Belegnr2,"","","").

DQL No.0006:

for AUFTRAG_POSITION with

Belegnr := data-entry Field1 and

Belegnr2 := data-entry Field2 ;

modify records in ARTIKEL

Bestand := Bestand - AUFTRAG_POSITION Anzahl ;

Letzter_Abgang := current date .

How can I do it?


Written by Rainer 08/11/14 at 09:46:04 Dataease [{8}]FIVE

Re:MemoExecDQL

I have to gather from your DQLs that this is just a test to explain the problem as it doesn't seem to make much meaning doing it like this ;-)

1. The first problem here is that you haven't defined Retval so that would cause a problem when you try to run the first DQL.

2. The main problem is context. We talk a lot about context when it comes to ExecDQL but I will try to explain it again.

A traditional DQL (DFW) is a self contained document on par with a form or report. It is loaded, executed and terminated within the context of being a self contained document. This means that you will only be able to manipulate the PRISM context of the DQL, and it also means that it has its own environment, so if you call other DQLs from inside it with Run Procedure etc they will share this environment (global) so you can transfer variables between them. 

This was highly necessary in DFD and also in DFW as there was no other good way of transferring values between processes.

ExecDQl is a completely different type of DQL. It use the same compiler and the same syntax, but it is in reality programming inside another document. If called from a Form it will share the CONTEXT of the form and this is why you can manipulate Screen objects etc from inside the ExecDQL called from this form.

Forms do not have Global Variables like DQL documents so it will make no sense to try to use Global variables inside a ExecDQL as they will not be shared between the different ExecDQLs.

However you don't need to. You can transfer variables between different ExecDQls via the 4 data-entry parameters or you can use SetVar(()/GetVar() to transfer up to 4000 variables between them. You can also use GetValue() to read values directly out of the forms field objects or even GetLabelText() to read it off labels or buttons....


Written by DataEase 10/11/14 at 06:33:59 Dataease [{8}]FIVE

Re:Re:MemoExecDQL

Download: Start out of a Form.doc

ok I understand I should not use "global" in execdql.

in my "start out of a Form" atatched it works.

but I learned now I should not do it.


Written by Rainer 10/11/14 at 11:35:40 Dataease [{8}]FIVE

Re:Re:Re:MemoExecDQL

Download: DQL0005.doc

In my DQL0005 I have the problem I mentioned in my first question. I marked two versions at the end of the doc. The rest of this DQL0005 works very well. ( I still use "global" but only inside the DQL - it works - is that ok?)

What do I do wrong?


Written by Rainer 10/11/14 at 11:42:25 Dataease [{8}]FIVE

Re:Re:Re:Re:MemoExecDQL

mybe the problem is this procedure. In DFD it works, but it does not work in normal DQL in DE 8.2 too. I try to update a related table.

DQL No.0006:

for AUFTRAG_POSITION with

Belegnr = data-entry Field1 and

Belegnr2 = data-entry Field2 ;

modify records in ARTIKEL

Bestand := Bestand - AUFTRAG_POSITION Anzahl ;

Letzter_Abgang := current date .


Written by Rainer 10/11/14 at 21:47:54 Dataease [{8}]FIVE

Re:Re:Re:MemoExecDQL

Hi!.

We tested this too and it "works" but what you will find is that there is a delay in the Global Variable, so the first time it will not work then the next time it will but it will be the global value from the previous run. So this will seem to work in test but it doesn't work in production!

Global variables in DQL was a "hack" implemented in DFD to allow DQLs to communicate and as they are not truly global (i.e. being accessible in the entire application) it is better to use the data-entry parameters in ExecDQL or GetVar()/SetVar() as the latter can also transfer values to forms etc.


Written by DataEase 11/11/14 at 09:07:58 Dataease [{8}]FIVE

Re:Re:Re:Re:MemoExecDQL

Does it work when you run it as ExecDQL but not when you try to run it as MemoExecDQL()?


Written by DataEase 11/11/14 at 09:14:39 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:MemoExecDQL

I think you are in a relational loop here.

DataEase always work on relationships so if there is a relationship between to table it will use the relationship and if there isn't it will create an "ad hoc" relationship.

To make sure I would make a new ad-hoc relationship to make sure that I updated the correct records.

for AUFTRAG_POSITION with

Belegnr = data-entry Field1 and

Belegnr2 = data-entry Field2 ;

modify records in ARTIKEL named "myrel" with etc...

Bestand := Bestand - AUFTRAG_POSITION Anzahl ;

Letzter_Abgang := current date .


Written by DataEase 11/11/14 at 09:16:02 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:MemoExecDQL

Do you have an idea?

I tried all, it does not have anything to do which DQL I use. (normal DQL, ecexdql, memoecexdql).

I made a copy "AUFTRAG_POSITION_1" and it worked. Then I deleted it and I made a copy again to "AUFTRAG_POSITION" and again it did not work.

Wath can I try. it took me houres so fare


Written by Rainer 17/11/14 at 15:33:54 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

p.s. wenn I do:

for AUFTRAG_POSITION with ...;

list records

any ARTIKEL Bestand .

it works - no problem?


Written by Rainer 17/11/14 at 16:09:08 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

We are sorry but you ask for an involvement in your application that we can't offer on here. We can answer simple request on specific problems, but we can't go into depth on application specific problems.


Written by DataEase Tech Sup. 17/11/14 at 18:23:26 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

Download: DQL0005.doc

ok I found the problem, it was a loop (circular reference).

But I have still the problem marked in the adattched file. I coloured it. The ecexdql works, but the MemoExecDQL not.


Written by Rainer 19/11/14 at 14:20:03 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

I guess we have done the same as you.

We have been staring on the code and can't see any difference...

1.There is no difference between execDQL and MemoExecDQL when the code id loaded i.e. executing it is the same.
2. So the problem must be in the loading. Try to insert a message into your MemoExecDQL to make sure you call the right one or it is called at all.

ExecDQL will not return an error message if you try to execute a blank DQL so if nothing happens that might be the problem.


Written by DataEase Tech Sup. 19/11/14 at 19:44:12 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

you are right. The memoexecqdl is not called at all. I tryed just to call a "massage("is it working") window." and it did not work either. Could it bee, That it does not work because of the "case value"?


Written by Rainer 20/11/14 at 11:09:59 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

some more info's. I put the Memoexecdql on the beginning of the DQL 0005 before the "case" statement. it works. and at the end after the last "end". it does not work.

wenn I start it out of an empty Form it works both on the beginning and at the end.


Written by Rainer 20/11/14 at 11:58:12 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

please answere


Written by Rainer 26/11/14 at 07:50:42 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

Dear Rainer and the rest of you.

This is an open user forum and not a DataEase support forum. Request on here will be answered by anyone that feel they have the inclination or time to answer/help. There is no limitations to what one can put on this forum, but there is obviously no guarantees of an answer or any deadlines for an answer.

Our team will answer request that we feel is of general interest and that can enhance the user bases understanding of DataEase in general.

We will answer quickly if the request is about how to use a function or functionality and we can answer from the top of our head.

Questions that will demand that we have to involve ourselves in a clients system will not be answered here as that is to be regarded as development assistance.


Written by DataEase 26/11/14 at 09:23:28 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

Dear …

I am not asking you, to involve in my client system.

Wenn you read my last two statements, it seems, that the menoecexdql does not load in combination with the “case value” statement. That would be a bug and of general interest.

All the best,
Rainer 


Written by Rainer 26/11/14 at 14:35:03 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:MemoExecDQL

Download Sample on Simple Sample

Dear Mr. Köllensperger.

Cases and MemoExecDQL() has been used extensively so it is not the combination in itself that goes wrong.

What we try to say is simply that to understand why it doesn’t work in your application we will need to analyse what you do and that is understanding the underlying structures etc.

We can’t involve ourselves to that level on every request as we don’t have the resources.

Programming is at times challenging and one doesn’t see the forest for all the threes but you can’t ask us to solve the problems every time you get stuck. You need to simplify your equation to remove all interfering functionality so you get it to work, and then add back the functionality till it stop working. That way you figure out what you do wrong.

There is no support included in purchase of a DataEase license, but it is in our interest to help you along so we do answer request on the forum if we think it can enlighten a wider public,but that is a service we render for free and must be at our own discretion.

However when the fine line between general enlightenment and personal favour is crossed we need to say sorry, this is something one need to figure out on ones own.

You can of course ask on the forum for help but you can’t demand it and if you ask for help you need to take the time to simplify the request so other users can spot the problem without going into deeper analysis of your application.

What we say is "prove" there is a problem by making a simple application that showcase the problem and we will look into it, but we can't read pages of codes taken out of an application and then play spot the "error". 

Everybody's time is precious so if you ask a favour make sure that it is one that people can afford to help you with.

Included in this reply you will find a simple sample where we test case and MemoExecDQL in the same DQL. It doesn't take much time to create such a sample and this is a clear cut way to showcase the "problem" or in this case the solution i..e that it works.

If you send problems in this manner we will try to look at it, but as stated above we will not look into user applications or code snippets derived thereof etc.
 


Written by DataEase 26/11/14 at 14:35:52 Dataease [{8}]FIVE
DG3_ForumList