From: hpuxrac on
On Dec 23, 7:35 am, Daneel Yaitskov <rtfm.rtfm.r...(a)gmail.com> wrote:

snip

> > BEGIN echo('dddddd'); --comment; END;
>
> > Notice  your comment in this context is considered as actual (but
> > invalid) code.  Do this instead:
>
> You must admit that such behavior strong  differentiate from others
> languages for the rule of one-line comment. Solid bulk of languages
>
> C++, Bash, C#, Haskell, Lisp, TeX  etc. consider that one-line comment
> can begin in any place of a line excepting strings (a text between ").
>
> I guess major portion of PL/SQL programmers have first language Basic,
> Pascal or C.
>
> My resume is this feature tends to errors.
> But I don't see any causes that PS/Sql's syntaxes must differentiate
> from the mainstream languages.
>
> Daneel Yaitskov

My guess is that you do not use PLSQL much ... as long as we are
offering wild guesses.

The line in question will work quite well as a comment in a real
procedure. When feeding it in a line at a time thru sqlplus well not
so much.

Perhaps one might actually test something out before offering broad
based opinions?

Just a thought ...
From: joel garry on
On Dec 23, 4:35 am, Daneel Yaitskov <rtfm.rtfm.r...(a)gmail.com> wrote:
> ddf wrote:
> > because what's happening is this:
>
> > BEGIN echo('dddddd'); --comment; END;
>
> > Notice  your comment in this context is considered as actual (but
> > invalid) code.  Do this instead:
>
> You must admit that such behavior strong  differentiate from others
> languages for the rule of one-line comment. Solid bulk of languages
>
> C++, Bash, C#, Haskell, Lisp, TeX  etc. consider that one-line comment
> can begin in any place of a line excepting strings (a text between ").
>
> I guess major portion of PL/SQL programmers have first language Basic,
> Pascal or C.
>
> My resume is this feature tends to errors.
> But I don't see any causes that PS/Sql's syntaxes must differentiate
> from the mainstream languages.
>
> Daneel Yaitskov

Frankly, your comments have more errors than your PL example.

You may use any language you desire, in any manner you desire. But if
you don't follow the basic rules of the language you are using, your
desire will remain unrequited. If you post to usenet your
misunderstanding of the rules in an arrogant manner, you are lucky you
don't get flamed. I think you are lucky here because your ignorance
is so obvious people just think you are still inexperienced enough to
excuse you.

jg
--
@home.com is bogus.
Local news as I'm typing this is saying "...never seen this before..."
http://www.usatoday.com/money/industries/energy/2008-08-04-gaspumpskimming_N.htm
From: George Rypysc on
On Wed, 23 Dec 2009 18:58:07 -0500, hpuxrac <johnbhurley(a)sbcglobal.net> wrote:

> On Dec 23, 7:35 am, Daneel Yaitskov <rtfm.rtfm.r...(a)gmail.com> wrote:
>
> snip
>
> My guess is that you do not use PLSQL much ... as long as we are
> offering wild guesses.
>
> The line in question will work quite well as a comment in a real
> procedure. When feeding it in a line at a time thru sqlplus well not
> so much.
>
> Perhaps one might actually test something out before offering broad
> based opinions?
>
> Just a thought ...
>


Bingo hpuxrac - the issue is with SQL*Plus, not the PL/SQL language:
"...SQL*Plus expects no text after a statement terminator and is unable to process the command." -- from SQL*Plus User's Guide and Reference, Release 10.2, Section: 'Notes on Placing Comments'
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch5.htm#sthref997

Daneel could also try moving the semi-colon to the end of the line to work around this quirk in SQL*Plus:

call echo('dddddd') -- comment;

....that's a bit odd, and inconsistent with PL/SQL comments, but runs fine in SQL*Plus. I believe it works because scripts must always end with a ';' or '/' (followed by a new line) if you run them in SQL*Plus or else they don't "finish". I bet Daneel ran the script, saw that a 'SQL>' prompt appeared with no error, and so assumed the entire script finished running. It didn't, because typing a '/' or ';' at the 'SQL>' prompt after executing the script reveals the error:

SQL> get script.sql
1 set serveroutput on;
2 create or replace procedure echo(msg varchar ) as
3 begin
4 dbms_output.put_line (msg);
5 end;
6 /
7 call echo('dddddd'); -- comment
8* -- the end of script
9 . <=== Manually typed a '.' here to get back to SQL> prompt.
SQL> @script.sql

Procedure created.

SQL> <=== Here it appears the entire script, including the 'call' ran. It didn't. (If your 'script.sql' file ends with only one blank line you may get a ' 3' instead of a 'SQL>' prompt). Typing 'show errors' here will return 'No errors.' because the 'call' line has not run yet! You need to type ';' or '/' so SQL*Plus passes the 'call' line to the database:

SQL> /
call echo('dddddd'); -- comment
*
ERROR at line 1:
ORA-00911: invalid character

....the error is revealed!
If you replace 'call' with 'exec', you get the error ddf mentioned above, instead of a silent, incomplete execution of the script. Seems like 'exec' is the better choice.

George
From: Frank van Bortel on
joel garry wrote:
> On Dec 23, 4:35 am, Daneel Yaitskov <rtfm.rtfm.r...(a)gmail.com> wrote:
<snip>
>> You must admit that such behavior strong differentiate from others
>> languages for the rule of one-line comment. Solid bulk of languages
>>
>> C++, Bash, C#, Haskell, Lisp, TeX etc. consider that one-line comment
>> can begin in any place of a line excepting strings (a text between ").
<snip>
>>
>> My resume is this feature tends to errors.
>> But I don't see any causes that PS/Sql's syntaxes must differentiate
>> from the mainstream languages.
>>
>> Daneel Yaitskov
>
> Frankly, your comments have more errors than your PL example.
>
> You may use any language you desire, in any manner you desire. But if
> you don't follow the basic rules of the language you are using, your
> desire will remain unrequited. If you post to usenet your
> misunderstanding of the rules in an arrogant manner, you are lucky you
> don't get flamed. I think you are lucky here because your ignorance
> is so obvious people just think you are still inexperienced enough to
> excuse you.

I was tempted very much to respond in such a manner.
Of course, bash and tex are NOT programming languages at all,
Haskell is NOT mainstream, and all the rest (C++, C# - yuk!
and Lisp) are much younger than PL/SQL.

Mr Yaitskov still has a lot to learn. One of these things
might be mastering the tool, before attempting to use it.
--

Regards,
Frank van Bortel
From: joel garry on
On Jan 6, 3:07 am, Frank van Bortel <frank.van.bor...(a)gmail.com>
wrote:
> joel garry wrote:
> > On Dec 23, 4:35 am, Daneel Yaitskov <rtfm.rtfm.r...(a)gmail.com> wrote:
> <snip>
> >> You must admit that such behavior strong  differentiate from others
> >> languages for the rule of one-line comment. Solid bulk of languages
>
> >> C++, Bash, C#, Haskell, Lisp, TeX  etc. consider that one-line comment
> >> can begin in any place of a line excepting strings (a text between ").
> <snip>
>
> >> My resume is this feature tends to errors.
> >> But I don't see any causes that PS/Sql's syntaxes must differentiate
> >> from the mainstream languages.
>
> >> Daneel Yaitskov
>
> > Frankly, your comments have more errors than your PL example.
>
> > You may use any language you desire, in any manner you desire.  But if
> > you don't follow the basic rules of the language you are using, your
> > desire will remain unrequited.  If you post to usenet your
> > misunderstanding of the rules in an arrogant manner, you are lucky you
> > don't get flamed.  I think you are lucky here because your ignorance
> > is so obvious people just think you are still inexperienced enough to
> > excuse you.
>
> I was tempted very much to respond in such a manner.
> Of course, bash and tex are NOT programming languages at all,
> Haskell is NOT mainstream, and all the rest (C++, C# - yuk!
> and Lisp) are much younger than PL/SQL.
>
> Mr Yaitskov still has a lot to learn. One of these things
> might be mastering the tool, before attempting to use it.
> --
>
> Regards,
> Frank van Bortel

The commands for shells aren't a programming language? That's a new
one on me. Could you explain more fully? From the wikipedia unix
shell entry: "Since it is both an interactive command language as well
as a scripting programming language it is used by Unix as the facility
to control (see shell script) the execution of the system." And tex
has macros... they may not be _good_ languages, but I write shell
scripts pretty much every day. On the other hand, maybe I just don't
remember what a programming language is. I often see a distinction
made between operating system commands and programs, but frankly, I
don't see the difference - even if you are poking binary into the OS.
The OS is a program, data can be a program. They're all telling the
computer what to do. Of course, I'm a big fan of writing a script,
even to do something once - maybe I've seen enough mistakes to just
not accept the difference. What's a command but a one-line script?
It's saved in a file for subsequent use, unless you really are
misconfigured.

Lisp is from 1958: http://en.wikipedia.org/wiki/Lisp_(programming_language)#History

(BTW, I was looking at Noons' blog, and hit the next blog button that
blogspot puts in, expecting some random page, but it seems to be
content-aware now. A couple of next's later, I hit your blog. Tried
it just now and got different blogs, though some were the same as the
previous time [on a different computer].)

jg
--
@home.com is bogus.
http://www.quantcast.com/oracle.com