Passing a parameter to a Where Clause in PL/SQL !

From: Kavous Niamir <KNiamir_at_home.com>
Date: Sat, 08 Dec 2001 18:07:06 GMT
Message-ID: <eFsQ7.31281$KT.7682567_at_news4.rdc1.on.home.com>



[Quoted] [Quoted] You will have to excuse me if this sounds a bit elementary, but I'm new to [Quoted] this stuff and have to find out ASAP. I have a VB application that passes several parameters to a PL/SQL package. These are used in a WHERE clauses of [Quoted] a SQL query. For example :

Select a_column
from a_table
where b_column = ai_str1

and     c.column  = ai_str2
and     d.column = ai_str3  -- the line I'm having problem with

Now my problem is that a user can either send a string for ai_str3 or a null [Quoted] value. How can I structure the query such that if the user sends a null value, the third condition would be simply ignored.. I have been thinking along the lines of having :

[Quoted] d_column = nvl(ai_str3, d_column)

Would that work or what do you think I should do? Received on Sat Dec 08 2001 - 19:07:06 CET

Original text of this message