According to KB, this code should work, yet, it is not compi

Posted by Rom Elwell on 07-Mar-2019 15:39

According to this KB: https://knowledgebase.progress.com/articles/Article/000036646

the following code snippet should be legal:

/* ***************************  Main Block  *************************** */
TRIGGER PROCEDURE FOR WRITE OF {&arg1}.{&arg2} NEW BUFFER upd{&arg2} OLD BUFFER orig{&arg2}.

However, the compiler is throwing the following error: Multiple markers at this line - ** Unable to understand after -- "TRIGGER". (247) - ** Invalid statement. (254) - **

Use Case: I am attempting to create a 'write trigger' template that will be used to create custom Write event procedures for every table in our DB schema.
I am passing the database-name {&arg1} and the table-name {&arg2}.

Does anyone have an suggestions on the syntax for the line of code above? Is this even doable anymore in OE 11.7?

Software Versions:
OpenEdge Developer 11.7 x64
Win10 x64

Posted by Rom Elwell on 13-Mar-2019 16:05

So, I have resolved this issue.  The root cause for the error in the dot-I file was my own ignorance.  The content of the include file was correct; the issue was with the partial implementation of the line of execution in the class that was using the include file. Once I realized this, it was able to resolve the datatypes/values for the arguments in the class including this content.

All Replies

Posted by frank.meulblok on 07-Mar-2019 16:24

How and when are you passing the arguments ?

The line of code itself is fine, as it works when you explicitly define the arguments in the same file (assuming you do have a sports2000 connected of course):


&SCOPED-DEFINE arg1 sports2000 &SCOPED-DEFINE arg2 customer TRIGGER PROCEDURE FOR WRITE OF {&arg1}.{&arg2} NEW BUFFER upd{&arg2} OLD BUFFER orig{&arg2}.

so the problem must be in how the arguments get set up.

Posted by Ken McIntosh on 07-Mar-2019 16:34

Hi Rom,

Is the code above an include file, which is being included into a program that provides values for the arguments, or are you trying to compile it as is?

Ken

Posted by Rom Elwell on 07-Mar-2019 16:37

Hi Ken,

The code snippet is in an *.i file and being included into a program that provides values for the arguments.

Posted by Ken McIntosh on 07-Mar-2019 17:17

I'd suggest logging a case with support.  It would be helpful to get your schema definition and the code (including the program you're compiling the .i into) that's failing.

I've tried this and can't get it to error.

Posted by Rom Elwell on 07-Mar-2019 17:22

Ken, it should not matter that I'm writing this code using OE Developer?

Posted by Ken McIntosh on 07-Mar-2019 17:36

No, not at all.  As long as the path is correct, and the database is connected.

You're referring to Developer Studio.  Right?

Posted by Rutger Olthuis on 07-Mar-2019 20:36

stupid question perhaps, but are you trying to compile the .i or the .p that's including the .i

The .i should not compile on it's own. If before you used the appbuilder, you didn't have an "auto compile" option. But perhaps the PDS settings are set to also compile .i files giving you that error.

Posted by Marco Mendoza on 07-Mar-2019 20:37

show us the .i arguments

Posted by Rom Elwell on 13-Mar-2019 16:05

So, I have resolved this issue.  The root cause for the error in the dot-I file was my own ignorance.  The content of the include file was correct; the issue was with the partial implementation of the line of execution in the class that was using the include file. Once I realized this, it was able to resolve the datatypes/values for the arguments in the class including this content.

This thread is closed