Tag Info

New answers tagged

1

Since this old question has been dug up anyway, I'll mention that you can use the built-in XQuery support in DB2 for regular expression matching, something along the lines of select whatever from users where xmlcast( xmlquery('fn:matches($USER_NAME,"^a[aofdmep][a-z][a-z0-9]{4}[sidbfkfpo]")') as integer) = 1 XMLQUERY above calls the XQuery ...


0

Building on Leigh Riffel and Joe's answers, you might consider using LIKE when you have a long list of individual characters, or when you have multiple character ranges. SELECT * FROM (SELECT 'afr923zs' MyString FROM SYSIBM.SYSDUMMY1) T WHERE substr(MyString,1,1) = 'a' AND 'aofdmep' like '%'||substr(MyString,2,1)||'%' AND substr(MyString,3,1) ...


0

Assuming: The record with the max tranno for a case also has the max date/time Combination of tranno and caseno is unique We can use the following query: SELECT a.caseno , a.date , a.time , a.tranno , b.pcode , c.pdesc , a.user FROM ( SELECT aa.caseno , MAX(aa.tranno) AS tranno FROM tablea aa WHERE ...


5

This is a typical "greatest N per group" problem which is usually solved using window functions: select caseno, date, time, tranno, pcode, pdesc, user from ( select a.caseno,a.date,a.time,a.tranno,b.pcode,c.pdesc,a.user, row_number() over (partition by a.caseno order by a.tranno desc) as rn from tablea a right join tableb b on ...


1

They probably do this because storage allocation on the mainframe is much more complex than for unix or windows platforms. zOS is basically a very modern sophisticated piece of harware and operating system that is emulating a 1960s mainframe. In much the same ways as the latest Intel chips are emulating a 1980s 386 chip. The problem is that the very low ...


0

I am new to DB2 but after a series of troubleshooting and success I can give you some help. When files are exported be careful to ensure that they are well-delimited. For example, with the following table CREATE TABLE ADMIN.TEST (C1 VARCHAR(30) , C2 TIMESTAMP , C3 DECIMAL(7,2) , C4 CHAR(1)) ORGANIZE BY COLUMN; ...



Top 50 recent answers are included