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

get the integer value , using SQL statement

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
Hi...

Let say I have an oracle database table name employee with badge column. sample data for this column are:
badge
-----
00004567
00002345
00012345
00012319
00234567

and i have a string , lets say '4567'. so i just want out information for employee 4567. I try to use this command :
SELECT * from employee where to_number(badge)='4567'

but looks like the statement is wrong. Have anyone any idea on this ?

Thanks and regards
Ron
 
Code:
toNumber
function returns a numeric. so when doing this :
Code:
SELECT * from employee where to_number(badge)='4567'
you try to compare a numeric and a string. Try :
Code:
SELECT * from employee where to_number(badge)=4567
Water is not bad as soon as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top