Re: fun debugging stuff on a friday

From: Rich Jesse <rjoralist_at_society.servebeer.com>
Date: Fri, 10 Apr 2009 11:49:51 -0500 (CDT)
Message-ID: <22c01002839954284b4fb67b9aa97cb4.squirrel_at_society.servebeer.com>



I see -- it's a coding or IDE issue, since that's a builtin function (never use it myself). If I had plopped your code into Toad, I would have seen that it highlighted "current_date" nicely. :D

I still stand by my recommendations and will add another: preface variable names to prevent confusion, e.g. "v_" for variable, "t_" for table/array, "p_" for parameter.

Confusing? Yes. Just like Oracle deciding to incorporate a new datatype that they themselves used as column names ("TIMESTAMP").

Have a Good Friday!

Rich

> To everyone who has replied,
>
> 1. not a cast issue
> 2. not a time trunc(date) issue
> 3. not what you think it is:
>
> the answer lies in current_date as a variable,
>
> select current_date from dual;
>
> so even if you set a variable called current_date and assign a value to
> it, when sql executes its completely ignored.
>
> took me a while to see it.
>
> joe

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Apr 10 2009 - 11:49:51 CDT

Original text of this message