473,379 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Is it possible to Hexadecimal or Binary Value as the input to WHERE clause in query?

Hi,

I am a newbie in DB2 and mainframe technology. While compiling a query
I cam across a situation where I had to give a Hex value as the input
to a query; i.e. WHERE file_status = x'00'. Is this correct.

More over if I were to give a BINARY as the input instead, How is it
done?

Please forgive if my question is baseless and silly. Guide me please.

Thank you very much.

Nov 12 '05 #1
3 12121
RdR
Hi,

You can try this:

"Select * from <table_name> where HEX(file_status)=x'00';" .

similar to "select HEX(file_status) from <table_name>;"

Hope this helps,

JWK(RdR)
"Praveen" <pr**************@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
Hi,

I am a newbie in DB2 and mainframe technology. While compiling a query
I cam across a situation where I had to give a Hex value as the input
to a query; i.e. WHERE file_status = x'00'. Is this correct.

More over if I were to give a BINARY as the input instead, How is it
done?

Please forgive if my question is baseless and silly. Guide me please.

Thank you very much.

Nov 12 '05 #2
RdR
Ooops,

It should be without the "x" in between "=" and the first single quote:

"Select * from <table_name> where HEX(file_status)='00';"

Thanks,

RdR

"RdR" <rr******@datamirror.com> wrote in message
news:ln********************@nnrp1.uunet.ca...
Hi,

You can try this:

"Select * from <table_name> where HEX(file_status)=x'00';" .

similar to "select HEX(file_status) from <table_name>;"

Hope this helps,

JWK(RdR)
"Praveen" <pr**************@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
Hi,

I am a newbie in DB2 and mainframe technology. While compiling a query
I cam across a situation where I had to give a Hex value as the input
to a query; i.e. WHERE file_status = x'00'. Is this correct.

More over if I were to give a BINARY as the input instead, How is it
done?

Please forgive if my question is baseless and silly. Guide me please.

Thank you very much.


Nov 12 '05 #3
Thanks a zillion RdR. That was really helpfull.

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christian | last post by:
HI, I have a function that is used to constrain a query: Select COl1, Col2 From MyTable WHERE col1 = ... AND col2 = ... And MyFunction(col1) = ... My problem is that MyFunction is executed...
1
by: george lewycky | last post by:
Is there someway I can make a parameter or variable of some sort to pass into my PL/SQL cursor shown below to change the value of the date without having to rebuild the package each time?? Can I...
4
by: Brian Shannon | last post by:
I have 3 combo boxes and two date text boxes on a .aspx page. The user can fill in any of the 5 controls or none to filter a datagrid. I was hoping someone could explain how to efficiently build...
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
6
by: Jared | last post by:
Consider the following two functionally identical example queries: Query 1: DECLARE @Name VARCHAR(32) SET @Name = 'Bob' SELECT * FROM Employees WHERE = CASE WHEN @Name IS NULL THEN ELSE...
4
by: Bernard Dhooghe | last post by:
Table definition: CREATE TABLE "SCHEMA1 "."X2" ( "C1" CHAR(20) NOT NULL , "C2" CHAR(10) NOT NULL , "C3" CHAR(30) NOT NULL GENERATED ALWAYS AS (C1|| C2) ) IN "USERSPACE1" ; -- DDL...
6
by: Plissskin | last post by:
I need to create an "ad-hoc" filtering page in a web app we are building. The page would display a number of drop down lists, text boxes, and radio lists and allow the user to select (enter) some...
1
by: rahullko05 | last post by:
Hi, i am building a small forum site as my final year project & stuck in a very trivial problem. I have a table which are varchar type of data & i am trying to fetch data from table based on...
2
by: Napsterr | last post by:
Following is the Code I am trying Declare @Day Int Set @Day=1 Select Mobile, Contact As Name, InTimeDay1 From uvw_UserDetails
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.