![]() | |
#1
| |||
| |||
|
|
| ' has bad check digit'); END IF; |
#2
| |||
| |||
|
|
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; ... |
#3
| |||
| |||
|
|
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; ... |
#4
| |||
| |||
|
|
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. |
#5
| |||
| |||
|
|
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. |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
Shakespeare a écrit : 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 such as http://download.oracle.com/docs/cd/A...6/13_elems.htm |
#8
| |||
| |||
|
|
Shakespeare a écrit : 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 such as http://download.oracle.com/docs/cd/A...6/13_elems.htm |
#9
| |||
| |||
|
|
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? http://download.oracle.com/docs/cd/A...82.htm#2064465 |
![]() |
| Thread Tools | |
| Display Modes | |
| |