Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> String comparisons in PL/SQL
Hopefully this question will be a simple one for somebody, but I am not that body.
For the life of me I am not able to test whether an input string into a stored procedure is the empty string
I figured that it would be simple but the following code always tests false...
AND (t.notes LIKE '%' || inNotes ||'%' OR (inNotes = '' AND t.notes IS NULL)) BTW, they are 2 single quotes just before the second 'AND'
I need to test this as I am doing pattern matching on table columns that may contain nulls. So my statement is basically saying
Find rows where column 'notes' contains the string variable 'inNotes' or, if 'notes' is null, then return the column if inNotes is blank (ie nothing was entered in this field in the input page).
Perhaps my explanation is a little more long winded that necessary, but I didn't want to miss the solution for want of explaining the problem.
TIA alan Received on Thu Aug 24 2000 - 20:28:47 CDT
![]() |
![]() |