数据仓库服务 GAUSSDB(DWS)-二进制类型:示例

时间:2024-12-24 10:32:34

示例

创建表:

1
2
3
4
5
6
7
CREATE TABLE blob_type_t1 
(
    BT_COL1 INTEGER,
    BT_COL2 BLOB,
    BT_COL3 RAW,
    BT_COL4 BYTEA
) DISTRIBUTE BY REPLICATION;

插入数据:

1
INSERT INTO blob_type_t1 VALUES(10,empty_blob(),HEXTORAW('DEADBEEF'),E'\\xDEADBEEF');

查询表中的数据:

1
2
3
4
5
SELECT * FROM blob_type_t1;
 bt_col1 | bt_col2 | bt_col3  |  bt_col4   
---------+---------+----------+------------
      10 |         | DEADBEEF | \xdeadbeef
(1 row)

删除表:

1
DROP TABLE blob_type_t1;
support.huaweicloud.com/sqlreference-dws/dws_06_0013.html