DB2 query to check the low values.

RDBMS from IBM and IBM's Hierarchical DBMS and Transaction Manager (IMS DC).
Post Reply
AnsulMainframe
New Member
Posts: 2
Joined: Wed Aug 13, 2014 10:03 am

DB2 query to check the low values.

Post by AnsulMainframe »

Hi,

I have a table called 'STATUSTABLE' with columns TName - Profile name of user and TStatus - Status of user. TName is CHAR and TStatus is VARCAR.
I need a SQL query to fetch those TNames with TStatus containing low values. When a status contains low values in BETWEEN as like below.

Code: Select all

Text - WHAT A GREAT MORNING!! 
it becomes a problem.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: DB2 query to check the low values.

Post by William Collins »

It is really unclear what you are asking.

Since binary-zeros don't display too well, can you indicate where they are in the data with a 0, please?

In your example, which is TName and which is TStatus?

Which problem are you getting with the binary-zero, are you using DB2 for z/OS or something else?
Chandan Yadav
Website Team
Website Team
Posts: 70
Joined: Wed Jul 31, 2013 10:19 pm

Re: DB2 query to check the low values.

Post by Chandan Yadav »

Hi,

Try this

Code: Select all

SELECT TNAME
  FROM STATUSTABLE
WHERE LOCATE(X'00',TSTATUS) > 1
This is untested but should work.

Thanks and regards,
Chandan
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DB2 and IMS DB/DC”