Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi line comment in oracle sqlplus

Tags:

sql

oracle11g

I have ran the below statements in sqlplus. It inserts duplicate of row 2. In log I have found that i row created after the comment line as well.
So, here I am asking the multi line comment should have a space between /* and comment and */ ?

insert into table values (1);  
insert into table values (2);  
/*comments here*/  
insert into table values (3);  
commit;  

Log:

SQL> insert into table values (1); 

1 row created.  

SQL> insert into table values (2);  

1 row created.  

**SQL> /*comments here*/  

1 row created.**  

SQL> insert into table values (3);  

1 row created.  

select A from table;  
A  
------------  
1  
2  
2  
3  
like image 821
CHANDRU S Avatar asked Nov 03 '25 22:11

CHANDRU S


1 Answers

All,

I have tried in sqlplus. We need to give the space or new line between /* and following characters. So it treated as multi line comment.

correct syntax:

/* comments here */

or

/* comments here */

Wrong syntax:

/*comments here*/

like image 111
CHANDRU S Avatar answered Nov 07 '25 09:11

CHANDRU S