Re: PL/SQL: DEFAULT vs. assignment
From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Fri, 02 Jan 2004 06:44:33 -0800
Message-ID: <1073054586.584734_at_yasure>
>
>
>
>
> I *know* that part of the documentation. I just don't understand it.
>
> For example, if I wrote
>
> foo_bar_baz INTEGER := 4711;
>
> instead of
>
> foo_bar_baz INTEGER DEFAULT 4711;
>
> would my program behave different in some point?
>
> Ronald
Date: Fri, 02 Jan 2004 06:44:33 -0800
Message-ID: <1073054586.584734_at_yasure>
Ronald Fischer wrote:
> "Ahmed Baraka" <baraka_ahmed_at_hotmail.com> wrote in message news:<bsuidn$i2614@news.emirates.net.ae>...
>
>>Use DEFAULT for variables that have a typical value. Use the assignment >>operator for variables (such as counters and accumulators) that have no >>typical value. >> >>A couple of examples follow: >> >>hours_worked INTEGER DEFAULT 40; >> >>employee_count INTEGER := 0;
>
>
>>Note: Taken from Oracle 8 documentation.
>
>
> I *know* that part of the documentation. I just don't understand it.
>
> For example, if I wrote
>
> foo_bar_baz INTEGER := 4711;
>
> instead of
>
> foo_bar_baz INTEGER DEFAULT 4711;
>
> would my program behave different in some point?
>
> Ronald
No difference. Same goes with SELECT DISTINCT and SELECT UNIQUE. Just two different ways to say the same thing.
But you should never use INTEGER as a datatype: Use PLS_INTEGER whenever applicable.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu [Quoted] (replace 'x' with a 'u' to reply)Received on Fri Jan 02 2004 - 15:44:33 CET