I'm sure there must be a really easy way to do this, but I can't figure out how, and a search hasn't yielded a solution. Here's what I want to do, but it's illegal:
That is, q_type has an integer value, and I want to populate q_name with a string value that depends on the value of q_type. I can do it with a separate set statement for every value of q_type, but I'd rather do it with a single call. Any ideas how to do it without getting into PL/SQL?
(Or not, if I haven't understood your requirements properly. Where does q_type come from?)
Joined: Dec 18, 2008
First, to answer your questions: Yes, Oracle SQL, and the table already contains a field, q_type, with a numeric value of 0-18. I want to add a field, q_name, that has a text value instead of a numeric value.
Thanks, I guess DECODE would do the trick. I did eventually devise an alternate solution.