Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CHR function in MySQL

Status
Not open for further replies.

sebes

Programmer
Apr 5, 2011
45
RO
Hola,

From what I understand, there's no CHR() function in MySQL or something to correspond to CHR from VFP.

(|Example: CHR(65) returns "A")

If anybody has an idea how to "simulate" it, please advise.

Thanks.
 
There is a function called CHAR() which does the same thing. It can event take more than one integer parameter and return the string generated from them:

Code:
SELECT CHAR(65 using ASCII)  ==> returrns "A"
SELECt CHAR(66,65,68 using ASCII) ==> returns "BAD"

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Ca I use it in something like:

SALECT .... WHERE field = CHAR(66,65,68 using ASCII) ?

Thanks.
 
Yes sure.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Right, I tested it already and it works.

Now, can I use something like this ?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top