Path: news.cambrium.nl!textnews.cambrium.nl!feeder3.cambrium.nl!feed.tweaknews.nl!195.96.0.7.MISMATCH!newsfeed.utanet.at!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Date: Mon, 12 Jan 2009 19:15:09 +0100
From: Shakespeare <whatsin@xs4all.nl>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.tools
Subject: Re: IS and AS
References: <gkfpg2$1187$1@biggoron.nerim.net> <496b6db5$0$195$e4fe514c@news.xs4all.nl> <gkft69$11jd$1@biggoron.nerim.net>
In-Reply-To: <gkft69$11jd$1@biggoron.nerim.net>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 48
Message-ID: <496b88b2$0$190$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 82.95.215.210
X-Trace: 1231784114 news.xs4all.nl 190 [::ffff:82.95.215.210]:2143
X-Complaints-To: abuse@xs4all.nl
Xref:  news.cambrium.nl

O_TEXT schreef:
> Shakespeare a écrit :
>> O_TEXT schreef:
>>> I was wondering what is the difference between IS and AS, in general
>>> PL/SQL code.
>>>
>>>
>>> For instance of FUNCTION book_t, how can oracle know if keyword ending
>>> the header is IS or AS;
>>> I mean if header returns SELF and declare result variable before BEGIN,
>>> or if header returns SELF AS RESULT and declare nothing before BEGIN.
>>>
>>>
>>> CREATE OR REPLACE TYPE BODY book_t
>>> AS
>>>    CONSTRUCTOR FUNCTION book_t (id IN INTEGER,
>>>       title IN VARCHAR2,
>>>       isbn IN VARCHAR2,
>>>       pages IN INTEGER)
>>>       RETURN SELF AS RESULT
>>>    IS
>>>    BEGIN
>>>       SELF.id := id;
>>>       SELF.title := title;
>>>       SELF.isbn := isbn;
>>>       SELF.pages := pages;
>>>       IF isbn IS NULL OR SELF.ck_digit_okay
>>>       THEN
>>>          RETURN;
>>>       ELSE
>>>          RAISE_APPLICATION_ERROR(-20000, 'ISBN ' || isbn
>>>             || ' has bad check digit');
>>>       END IF;
>>>    END;
>>> ...
>> It's all a matter of parsing....
>>
>> Shakespeare
>>
>> BTW: in many cases, AS and IS are interchangeable.
> 
> Is it possible to know on which rule PLSQL is based for parsing?
> 
> 
> 
You could check out the syntax diagrams in the docs.

Shakespeare
