Home » SQL & PL/SQL » SQL & PL/SQL » Help with PLSQL code for searching (oracle 10.2.0.4.0)
Help with PLSQL code for searching [message #377623] Tue, 23 December 2008 23:49 Go to next message
nbmunnangi
Messages: 1
Registered: December 2008
Junior Member
hi all,
in my application there is a requirement for searching through table and return rows...

--there is a product table which has columns productcode, price, quantity, description...
--user should be able to search using productcode or description or price range and return the rows...

please guide me through this...

thanks in advance...
Re: Help with PLSQL code for searching [message #377624 is a reply to message #377623] Wed, 24 December 2008 00:03 Go to previous messageGo to next message
trivendra
Messages: 211
Registered: October 2007
Location: Phoenix
Senior Member
Hi,

You can user DECODE or CASE statement after where clause.

like

DECODE(productcode,:input_productcode,null,productcode,:input_productcode)
and
DECODE(price,:input_price,null,price,:input_price)

Thanks
Trivendra

[Updated on: Wed, 24 December 2008 00:26]

Report message to a moderator

Re: Help with PLSQL code for searching [message #377634 is a reply to message #377623] Wed, 24 December 2008 00:46 Go to previous message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Use 3 queries.

Regards
Michel
Previous Topic: Repeated static SQL sections in PL/SQL packages
Next Topic: ORA-12805: parallel query server died unexpectedly
Goto Forum:
  


Current Time: Fri Dec 13 00:32:26 CST 2024