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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to convert number to char in select

Status
Not open for further replies.

ctshiva

Programmer
Dec 14, 2001
7
US
Hi there,
I need to convert number to char in a select statement.
thanks
Shiva
 
Shiva:

Generally, Informix does data conversions when it can so converting a character string containing all numeric characters should happen with no problems.

If you're having a specific problem, please post the code.

Regards,

Ed
 
Hi Olded,
thanks for the reply.

I am in a situation like i need to execute this query.

select * from emp where emp_id like '1%'

since the EMP_ID is the numeric,I could not use the wild card character on numeric.

Current Scenario:
I developed a asp page with informix as back end.
In that asp page,i have a search based on emp_id,
user can enter first few characters of emp_id & i have to show the all the emp_id starting with that characters.

I am able to use the above mentioned query on the record set.

If u have any idea,please let me know.
thanks for ur help.appreciated.
shiva


 
Hi,

If the emp_id is numeric field, the SQL
select * from emp where emp_id like '1%' ;

will result into:
219: Wildcard matching may not be used with non-character types.

Workaround:
select * from emp where rpad(emp_id,10,' ') like '1%' ;

Regards,
Shriyan

"If you have knowledge, let others light their candles with it."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top