Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the comments in pl/sql

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the notes in pl/sql". The explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the notes in pl/sql".

Comments are divided into single-line comments and multi-line comments.

1. Single-line comments use "-".

DECLARE

Howmany NUMBER

Num_tables NUMBER

BEGIN

-- Begin processing

SELECT COUNT (*) INTO howmany

FROM USER_OBJECTS

WHERE OBJECT_TYPE = 'TABLE';-- Check number of tables

Num_tables: = howmany;-- Compute another value

END

two。 Multiline comments begin with "/ *" and end with "* /".

DECLARE

Some_condition BOOLEAN

Pi NUMBER: = 3.1415926

Radius NUMBER: = 15

Area NUMBER

BEGIN

/ * Perform some simple tests and assignments * /

IF 2 + 2 = 4 THEN

Some_condition: = TRUE

/ * We expect this THEN to always be performed * /

END IF

/ * This line computes the area of a circle using pi

Which is the ratio between the circumference and diameter.

After the area is computed, the result is displayed. , /

Area: = pi * radius**2

DBMS_OUTPUT.PUT_LINE ('The area is:' | | TO_CHAR (area))

END

2. Notes should be paid attention to.

1. Multiline comments cannot be nested, such as the following is wrong:

/ *

IF 2 + 2 = 4 THEN

Some_condition: = TRUE

/ * We expect this THEN to always be performed * /

END IF

, /

two。 Single-line comments can be nested within multiline comments:

/ *

IF 2 + 2 = 4 THEN

Some_condition: = TRUE

-- We expect this THEN to always be performed

END IF

, /

Thank you for your reading, these are the contents of "what are the comments in pl/sql". After the study of this article, I believe you have a deeper understanding of what the comments in pl/sql have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report