Re: Oracle NULL vs '' revisited
- From: William Robertson <williamr2019@xxxxxxxxxxxxxx>
- Date: Tue, 21 Aug 2007 14:05:53 -0000
On Aug 20, 9:19 pm, Matthew Harrison <m.harris...@xxxxxxxxxxx> wrote:
William Robertson wrote:
myproc()
and
myproc(NULL)
more between
myproc('')
and
myproc(NULL)
However, myproc(NULL) never gets called ... only ... there is never the
need to tell the system a message has not been sent.
--
Pinging self [127.0.0.1] with 32 bites of banana cake:
Ping statistics for 127.0.0.1:
Slices: Sent = 4, Received = 0, Lost = 4 (100% loss),
To distinguish between null and '' parameter values, try something
like this:
CREATE OR REPLACE PROCEDURE distinguish_emptiness
( p_msg VARCHAR2 )
AS
v_msg CHAR(50) := p_msg;
BEGIN
IF v_msg IS NULL THEN
DBMS_OUTPUT.PUT_LINE('NULL');
ELSE
DBMS_OUTPUT.PUT_LINE('String with length ' || LENGTH(v_msg));
END IF;
END;
/
SQL> exec distinguish_emptiness(NULL);
NULL
PL/SQL procedure successfully completed.
SQL> exec distinguish_emptiness('')
String with length 50
PL/SQL procedure successfully completed.
.
- References:
- Oracle NULL vs '' revisited
- From: Matthew Harrison
- Re: Oracle NULL vs '' revisited
- From: zigzagdna
- Re: Oracle NULL vs '' revisited
- From: David Portas
- Re: Oracle NULL vs '' revisited
- From: zigzagdna
- Re: Oracle NULL vs '' revisited
- From: DA Morgan
- Re: Oracle NULL vs '' revisited
- From: zigzagdna
- Re: Oracle NULL vs '' revisited
- From: Matthew Harrison
- Re: Oracle NULL vs '' revisited
- From: William Robertson
- Re: Oracle NULL vs '' revisited
- From: Matthew Harrison
- Oracle NULL vs '' revisited
- Prev by Date: Slow query with Oracle 10G
- Next by Date: oracle rownum
- Previous by thread: Re: Oracle NULL vs '' revisited
- Next by thread: Re: Oracle NULL vs '' revisited
- Index(es):
Relevant Pages
|