Command Window and end-of-line comments

CTzen

Member³
v 6.0.1

Code:
SQL> alter table TASK add (STATUS			NUMBER); -- line comment
  2
SQL> alter table TASK add (STATUS			NUMBER);

Table altered
if there is in-line comment present after ";", then command is not executed.

Same for multiline statements

Code:
SQL> -- Create/Recreate primary, unique and foreign key constraints
SQL> alter table TASK
  2    add constraint fk$task$user_type foreign key (TASK_OWNER)
  3    references user_type (USER_TYPE)
  4  ; -- Test comment
  5
 
This is "compatible" with SQL*Plus. It doesn't make much sense though, so perhaps we can improve on this behavior.
 
Marco,

indeed, SQL*Plus behaves the same. I'm not sure in this case if you need to "improve" it. It's your call.

And you're right, it doesn't make any sense, perhaps it's SQL*Plug :)
 
Back
Top