Chapter 1. Declaring Variables and Naming Elements
Beginner
Q: | |
1-1. | The following variables are valid or invalid for these reasons:
|
Q: | |
1-2. | Oddly enough, (a) compiles, while (b) fails with the following error message: PLS-00371: at most one declaration for 'LASTDATE' is permitted PL/SQL is a case-insensitive language (except for the contents of literal strings). Therefore, in both cases you are trying to declare two variables with the same name, which is not allowed. It turns out, however, that the compiler will not reject the duplicate declarations unless you actually try to use one of the variables! |
Q: | |
1-3. | Here is an example that demonstrates these two formats and shows that the same value is assigned: DECLARE myDate DATE := SYSDATE; yourDate DATE DEFAULT SYSDATE; BEGIN ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access