ESLQ Basic Knowledge Practice--practice One

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.