开发者社区> 问答> 正文

How do you write comments in a PL/SQL code?

已解决

How do you write comments in a PL/SQL code?

展开
收起
1780169608831412 2021-10-16 18:04:27 563 0
1 条回答
写回答
取消 提交回答
  • 网络规划设计师、敏捷专家、CISP、ITSS服务经理、ACA全科目、ACP4项、ACE、CBP、CDSP、CZTP等。拥有 PRINCE2 Foundation/Practitioner、CCSK、ITIL、ISO27001、PMP等多项国际认证。 专利5+、期刊10+、知识产权师。核心期刊审稿人。
    采纳回答

    Comments are those sentences that have no effect on the functionality and are used for the purpose of enhancing the readability of the code. They are of two types:

    Single Line Comment: This can be created by using the symbol -- and writing what we want to mention as a comment next to it.
    Multi-Line comment: These are the comments that can be specified over multiple lines and the syntax goes like /* comment information */
    

    Example:

    SET SERVEROUTPUT ON; 
    DECLARE 
     
    -- Hi There! I am a single line comment.
    var_name varchar2(40) := 'I love PL/SQL' ;  
    BEGIN 
     /* 
     Hi! I am a multi line
     comment. I span across
     multiple lines
     */
    dbms_output.put_line(var_name);
    END; 
    /
    Output:
    I love PL/SQL
    
    2021-10-16 18:18:14
    赞同 2 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
SQL Server 2017 立即下载
GeoMesa on Spark SQL 立即下载
原生SQL on Hadoop引擎- Apache HAWQ 2.x最新技术解密malili 立即下载