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

Decode - based on 1st character of field

Status
Not open for further replies.

anniez

IS-IT--Management
Apr 13, 2001
43
US
I have a character field, UNIT.
It could have any value from 000 to 999.
I want to update the field, GROUP, to be "WBU" when UNIT begins with '3'. Do I use the substr() function within the decode? Something like this?

group=decode(substr:)new.UNIT,1,1),3,'WBU')


Thanks
 
Hi,
Should work, have you tested it?
( Pl/Sql may not know about substr, however)
[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top