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 ... |