sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Praveen's Avatar

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


Question posted by: Praveen (Guest) on November 12th, 2005 10:10 AM
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.

3 Answers Posted
RdR's Avatar
Guest - n/a Posts
#2: Re: Is it possible to Hexadecimal or Binary Value as the input to WHERE clause in query?

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" <praveen.unnithan@gmail.com> wrote in message
news:1107773354.755779.44810@l41g2000cwc.googlegro ups.com...[color=blue]
> 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.
>[/color]


RdR's Avatar
Guest - n/a Posts
#3: Re: Is it possible to Hexadecimal or Binary Value as the input to WHERE clause in query?

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" <rrosario@datamirror.com> wrote in message
news:lnPNd.90493$vO1.566400@nnrp1.uunet.ca...[color=blue]
> 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" <praveen.unnithan@gmail.com> wrote in message
> news:1107773354.755779.44810@l41g2000cwc.googlegro ups.com...[color=green]
> > 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.
> >[/color]
>
>[/color]


Praveen's Avatar
Guest - n/a Posts
#4: Re: Is it possible to Hexadecimal or Binary Value as the input to WHERE clause in query?

Thanks a zillion RdR. That was really helpfull.

 
Not the answer you were looking for? Post your question . . .
196,926 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,926 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors