Basic Sql statement need advice on [message #304743] |
Thu, 06 March 2008 08:11  |
californiagirl
Messages: 79 Registered: May 2007
|
Member |
|
|
Hi all,
This sql statement is going into an autoaccounting rule in Oracle Apps. I just wanted to get a second opinion on it..to see if it was ok or can be better. I guess I am really concerned about the second like..let me know what you think.
select decode(ps.segment_value,:1,'PC',12) from apps.pa_segment_value_lookups ps
where ps.segment_value_lookup like
'TNPRC%' or ps.segment_value_lookup
like 'Tulake Natl Primative Rsch Center';
|
|
|
|
Re: Basic Sql statement need advice on [message #304746 is a reply to message #304743] |
Thu, 06 March 2008 08:18   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Why did you use a LIKE operator in the second part? There is no wildcard in the value, so you can use =
It would (most probably) not make any difference at runtime, but you asked for a review.
Also, make sure that the possible return-values from your decode have the same data-type (now it's either the string 'PS' or the number 12)
|
|
|
|