I am enrolled at the Art Institute of Pittsburgh - Online working towards a Bachelor of Science in photography.
My other blog [blogspot.com]
I like to put comments in my files containing PL/SQL statements and it recently bit me. Perhaps you have already been bitten by it or knew of this behavior already. SQL*Plus' parser has what I consider a bug. Comments (single and multiline) cannot follow a command terminator (semicolon or slash).
SQL> -- good
SQL> -- good
SQL> select * from dual -- good
2/
D
-
X
SQL> select * from dual -- good
2;
D
-
X
SQL> select * -- good
2 from -- good
3 dual -- good
4;
D
-
X
SQL> select * -- good
2 from -- good
3 dual -- good
4/
D
-
X
SQL> select * from dual; -- bad
2/
select * from dual; -- bad
*
ERROR at line 1:
ORA-00911: invalid character
SQL> select * from dual
2 / -- bad
3/
/ -- bad
*
ERROR at line 2:
ORA-00933: SQL command not properly ended
SQL>/* good */
SQL> select * from dual/* good */
2/
D
-
X
SQL> select * from dual/* good */
2;
D
-
X
SQL> select */* good */
2 from/* good */
3 dual/* good */
4;
D
-
X
SQL> select */* good */
2 from/* good */
3 dual/* good */
4/
D
-
X
SQL> select * from dual;/* also bad */
2/
select * from dual;/* also bad */
*
ERROR at line 1:
ORA-00911: invalid character
SQL> select * from dual
2 //* also bad */
3/
//* also bad */
*
ERROR at line 2:
ORA-00933: SQL command not properly ended
Memory jog (Score:2)
I knew there was a reason I got into the habit of typing semicolons and slashes on a line by themselves. There are probably other weirdnesses too.
Re: (Score:2)
Interface between two languages (Score:2)
I agree this is bad design, but I think it springs from the subtle difference between the Oracle SQL language and the SQL*Plus program language. Oracle is a madness of interfacing between different languages: PL/SQL, SQL, and SQL*Plus are three separate languages to learn, and they all tend to embed each other. I remember having to explain about three times to a former manager why I could not run an SQL*Plus report from PL/SQL stored in the database before she finally got it.
Strangely enough, even thoug
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers