Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Posts
    276

    Unanswered: what happens here??

    What is actually happening here...??

    SQL> /*
    SQL> desc dept
    SQL> */
    SQL>desc dept
    deptno location
    ..
    ..
    ..

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Did you post the screen output? What are those dots?

    Here's the same on my 10g:
    Code:
    SQL> /*
    SQL> desc dept
    SQL> */
    SQL> desc dept
     Name                                      Null?    Type
     ----------------------------------------- -------- -------------
    
     DEPTNO                                    NOT NULL NUMBER(2)
     DNAME                                              VARCHAR2(14)
     LOC                                                VARCHAR2(13)
    
    SQL>
    It seems quite normal to me. Could you explain it a little bit more? How did you get it? Were those lines the only ones you wrote since you started the SQL*Plus session? How do your glogin.sql and login.sql files look like?

  3. #3
    Join Date
    Jul 2005
    Posts
    276
    sorry to sidetrack you. What exactly I was asking was
    SQL>
    SQL> what i was asking was
    SP2-0734: unknown command beginning "what i was..." - rest of line ignored.
    SQL> /*
    SQL> what
    SQL> i was
    SQL> asking
    SQL> */
    SQL> aask
    SP2-0042: unknown command "aask" - rest of line ignored.
    SQL>
    whenever you type any command not recognized by Oracle, it gives you a message 'unknown command...'

    And when you type between /*....*/ its commented.
    What exactly is the use of comments at sqlplus prompt.....??

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Comment is a part of the code and is usually used to explain this code. Also, compilers (and interpreters) ignore it. The same goes for SQL*Plus, no difference - it suggests that you've writen something that shouldn't be executed.

    BASIC uses REM as comment (re)mark; DCL on OpenVMS uses ! sign for the same purpose. Oracle accepts -- or a pair of /* and */ for a comment.

    Actually, there's nothing revolutionary in comments.

  5. #5
    Join Date
    Oct 2006
    Posts
    2
    And just an FYI, in oracle /* */ is a comment, but /*+ */ is an optimizer hint ;-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •