1. Declaring variables, setting variable values (parsing XML format messages, IBM recommends using XMLNSC, rather than XML, if the incoming message is not known in what format, it is resolved with a BLOB to maximize fault-tolerant processing).
DECLARE jms_date CHAR;
SET Jms_date=current_timestamp;
SET OUTPUTROOT.XMLNSC. (XMLNSC. XmlDeclaration) *. (XMLNSC. Attribute) Version = Dataspec_tips_ver;
2. Referencing functions under other packages (note: The variables inside the other package, even if declared as shared, cannot be referenced by other esql (i.e. consulting an IBM expert, but not after the experiment), if you want to reference, you can define a function, the corresponding variable as the return value, passed to the corresponding esql file, To achieve the purpose of the reference)
SET OUTPUTROOT.XMLNSC. (XMLNSC. XmlDeclaration) *. (XMLNSC. Attribute) Encoding = tips_xml_encoding ();
The esql file header must use the PATH keyword to indicate the referenced file:
Path ESQL.COMMON,ESQL.ACTION.CTAIS.G1; (if common is a folder in Esql.common, all esql files below it are referenced)
3. referencing parameter variables in incoming message flows
DECLARE enviromentxmlt msg REFERENCE toEnviroment.Variables.XMLTmsg.XMLNSC;--Technical body information
DECLARE enviromentxmldmsg REFERENCE toEnviroment.Variables.XMLDmsg.XMLNSC;--Business body information
4. Delete the resolution node of a node in an environment variable
DELETE FIELD Enviroment.Variables.XMLTmsg;
DELETE FIELD Enviroment.Variables.XMLDmsg;
5. In the message flow, specify multiple destination queues simultaneously (seemingly specified and sent simultaneously, but its runtime is serial and cannot be determined in its order, but guaranteed to be all sent)
Method One:
SET outputlocalenviroment.destination.mqdestinationlist.destinationdate[1].queuename = specified queue name 1;
SET outputlocalenviroment.destination.mqdestinationlist.destinationdate[2].queuename = specified queue name 2;
SET outputlocalenviroment.destination.mqdestinationlist.destinationdate[3].queuename = specified queue name 3;
(Note: Be sure to set the return value to true, otherwise it may be sent only after the first, subsequent cannot specify and send the message)
Method Two:
IF EXISTS (outputroot.xmlnsc.msg.msgheader[]) then--------logical judgment
PROPAGATE to TERMINAL ' out1 ';
PROPAGATE to TERMINAL ' out2 ';
ELSE
PROPAGATE to TERMINAL ' out3 ';
PROPAGATE to TERMINAL ' Out4 ';
RETURN FALSE;
(Note: Be sure to set the return value to false, otherwise it may be sent only after the first, subsequent cannot specify and send the message)
ESLQ Basic Knowledge Practice--practice One