Overriding a XPX Function or Procedure

This phenomenon can actually be explained. In XPX it is legal to “override” a built-in function or procedure by defining one with the same name. The one declared in the query schema will take precedence. Now, the “xpx” functions can be used both as functions and procedures, which in XPX are two distinct types. Then means that by declaring a FUNCTION xpxPrintf the locally declared function will be called instead of the built-in one. However, the override does not affect where xpxPrintf is used as a PROCEDURE. So everywhere wherew xpxPrintf() is used as a procedure:

 

                xpxPrintf(‘This is a message\n’);

 

The original built-in version will be used. However, if you tried to use xpxPrintf() as a FUNCTION according to built-in signature:

 

                rstat := xpxPrintf(‘This is a message\n’);

 

It would generate an error, as the actual function would be taken as the one declared in work_order_queries.

 

XPX definitively not a language for amateurs