Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    184

    Unanswered: another feature of edlin err I mean SQL+

    I just encountered an interesting buglet in a spool file from one of my scripts.

    I have a script that creates a table

    create mytable (mcol number,...);

    /*followed by a comment in this
    format
    */

    When the script encountered the /*, it only saw the / and assumed I wanted to create the table again so it issued the message:

    "Object mytable already exists."

    Anyone seen this before?

    Thanks.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Yes, it is usual in Oracle (and, I believe, in other databases too):
    Code:
    SQL> $type a.sql
    create table brisime (a number);
    
    /* this is a comment
      asdf
    */
    
    SQL> spool a.lis
    SQL> @a
    
    Table created.
    
    DOC>  asdf
    DOC>*/
    SQL> spool off
    SQL>
    SQL>
    SQL>
    SQL> -- but watch this!
    SQL>
    SQL> spool a.lis
    SQL> @a
    create table brisime (a number)
                 *
    ERROR at line 1:
    ORA-00955: name is already used by an existing object
    
    
    DOC>  asdf
    DOC>*/
    SQL> spool off
    SQL>
    I guess table "mytable" already existed in this schema (whether it was a table, procedure, function ...) before you run your script. Comment has nothing to do with it.

  3. #3
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    Can you post an example of the behaivour you're seeing rtnetworks ? I can't reproduce what you're saying. I believe what causes the table to be created was the ; at the end not the begining of the comment itself.

    I am missing something or is this the expected behaivour Litlefoot ?

Posting Permissions

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