Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does exactly do the command "REM INSERTING into TABLE_NAME" in Oracle?

Tags:

sql

oracle

I have some SQL scripts for Oracle and I wonder to know exactly what is the objective of the following line:

REM INSERTING into TABLE_NAME

After this line I get the inserts for the table.

Insert into TABLE_NAME (ID,ENUM_KEY,NAME,DESCRIPTION) values (3,3,'T_EXIT_POINT','T_EXIT_POINT'); Insert into TABLE_NAME (ID,ENUM_KEY,NAME,DESCRIPTION) values (4,4,'T_CONDITION','T_CONDITION'); 

Anyone can explain me this REM INSERTING, or where to find documentation about it?

like image 953
MadMad666 Avatar asked Jan 19 '12 19:01

MadMad666


People also ask

What Is REM inserting into in Oracle?

REM[ARK] Begins a comment in a script. SQL*Plus does not interpret the comment as a command. Usage. The REMARK command must appear at the beginning of a line, and the comment ends at the end of the line.

What does set define off do?

Is the command, which may be abbreviated SET DEF. OFF. Disables variable substitution. ON. Enables variable substitution, and resets the substitution prefix character back to the default ampersand (&) character.

How set define off in Oracle package?

"set define off" is a sql*plus command. You should call it before calling the stored procedure, not within the procedure. Show the details, How the procedure looks like, How you are calling the procedure and from where (which client), and what is the exact problem you are facing.

Why we use set define off in Oracle?

If there are any, the client will stop and ask you to supply a value for the variable. At which point it'll change your code to include this text. So unless you know your script includes these variables, it's best to set define off. This avoids unexpected changes to your data & code!


1 Answers

REM, or short for REMARK, is used in SQL*Plus to indicate the beginning of a comment in a SQL script. Read more about REM in the documentation here.

Instead of

 REM INSERTING into TABLE_NAME  

I suggest you use PROMPT

 PROMPT INSERTING into TABLE_NAME  

That way the script output would contain the string "INSERTING into TABLE_NAME".

More about PROMPT here. It's especially useful when you have ECHO OFF.

like image 79
Eddie Awad Avatar answered Sep 20 '22 10:09

Eddie Awad