圈子推荐
查看所有吧>>
活跃用户
    atlasdb 兼容oracle 特性之dbms_assert

           DBMS_ASSERT提供断言输入值的各种属性的函数。如果不满足确定函数中断言的属性的条件,则会引发值错误。否则,通过返回值返回输入值


    实验:

    atlasdb=# SELECT dbms_assert.enquote_literal('SERVERS') FROM dual;

     enquote_literal

    -----------------

     'SERVERS'

    (1 row)

    atlasdb=# SELECT dbms_assert.enquote_name('SERVERS') FROM dual;

     enquote_name

    --------------

     "servers"

    (1 row)

     

    atlasdb=# SELECT dbms_assert.enquote_name('"SERVERS"') FROM dual;

     enquote_name  

    ---------------

     """servers"""

    (1 row)

     

    atlasdb=# SELECT dbms_assert.noop('SERVERS') FROM dual;

      noop   

    ---------

     SERVERS

    (1 row)

    atlasdb=# SELECT dbms_assert.QUALIFIED_SQL_NAME ('UWCLASS.SERVERS1') FROM dual;

     qualified_sql_name

    --------------------

     UWCLASS.SERVERS1

    (1 row)

    atlasdb=# SELECT dbms_assert.schema_name('oracle') FROM dual;

     schema_name

    -------------

     oracle

    (1 row)

    atlasdb=# SELECT dbms_assert.schema_name('UWCLASZ') FROM dual;

    ERROR:  invalid schema name

    atlasdb=# SELECT dbms_assert.simple_sql_name('SERVERS1') FROM dual;

     simple_sql_name

    -----------------

     SERVERS1

    (1 row)

    atlasdb=# SELECT dbms_assert.object_name('PG_TEMP_3') FROM dual;

    ERROR:  invalid object name

    atlasdb=# create table atlasdb.mytab (id int);

    CREATE TABLE

    atlasdb=# SELECT dbms_assert.object_name('mytab') FROM dual;

     object_name

    -------------

     mytab

    (1 row)


    • 分享到:
    排序方式:回复时间 共有0条评论