Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> String comparisons in PL/SQL

String comparisons in PL/SQL

From: alan <alan_at_kenamea.com>
Date: Fri, 25 Aug 2000 01:28:47 GMT
Message-ID: <39a5cbbd.34173468@news.pacbell.net>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US