extended-sql

IIB: Passing local variable to ESQL select statement

梦想的初衷 提交于 2019-12-25 14:40:53
问题 I need to retrieve datas from two tables based on the Job code which is given in the input xml in IIB/WMB. SQL Query SELECT D.DEPTNO,D.DNAME,D.LOC,E.EMPNO,E.ENAME,E.JOB,E.SAL FROM DEPT D JOIN EMP E on E.JOB ='MANAGER' OR E.JOB = 'CLERK' ESQL Query Getting the JOB details from input xml and assigning it to local variable. SET type1 = InputRoot.XMLNSC.Employee.Type[1]; SET type2 = InputRoot.XMLNSC.Employee.Type[2]; Now I need to pass the above variables to my ESQL query. SET Outputroot.XMLNSC

How to convert String to BLOB in ESQL?

China☆狼群 提交于 2019-12-11 04:43:06
问题 It should be as simple as SET OutputRoot.BLOB.BLOB = CAST(MYSTRING AS BLOB); But when I do that IIB Throws an error An attempt was made to cast the character string ''ABC'' to a byte string, but the string was of the wrong format. There must be an even number of hexadecimal digits (0-9, a-f, A-F). 回答1: In my case I needed to change it to AS BLOB CCSID 1208 I need to read up on what CCSID means now. 回答2: As you figured out, the Syntax of the CAST-function you need here is CAST( <source

ESQL for splitting a string into mulitple values

て烟熏妆下的殇ゞ 提交于 2019-12-11 02:38:12
问题 Following Input xml field needs to be substringed for 6 characters and each 6 characters should be splitted and saved in the option field of output. Input: <feature>124414500045563879</feature> output: <option>124414</option> <option>500045</option> <option>563879</option> Is there any tokenizer function available in IIB ESQL to achieve the above result. 回答1: As far as I know, no there isn't a String Tokenizer function in ESQL. But you could use the following procedure as base to achieve your