返回首页

gbase数据、南大通用产品文档:GBase8s保留字和关键字

更新日期:2024年09月11日

PL/SQL中有一些具有特殊意义的标识符,被称作保留字和关键字。不能使用保留字做
为用户定义的标识符。可以用关键字作为用户定义的标识符。

CREATE TABLE...LIKE...
功能说明
复制table_name2 的表结构来创建表table_name1。
语法格式
CREATE TABLE [vc_name.][db_name.]table_name1 LIKE table_name2;
示例

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
952
示例1:创建随机分布表。
gbase> DROP TABLE IF EXISTS t5;
Query OK, 0 rows affected
gbase> CREATE TABLE t5(a int,b datetime);
Query OK, 0 rows affected
gbase> INSERT INTO t5 VALUES(1,NOW());
Query OK, 1 row affected
gbase> CREATE TABLE t6 LIKE t5;
Query OK, 0 rows affected
gbase> SHOW CREATE TABLE t6;
+-------+---------------------------------------------------------+
| Table | Create Table
|
+-------+---------------------------------------------------------+
| t6
| CREATE TABLE "t6" (
"a" int(11) DEFAULT NULL,
"b" datetime DEFAULT NULL
)
ENGINE=EXPRESS
DEFAULT
CHARSET=utf8
TABLESPACE='sys_tablespace' |
+-------+---------------------------------------------------------+
1 row in set
gbase> SELECT * FROM t6;
Empty set

SQLNumParams 返回 SQL 语句中参数的数量。

GBase 8s ODBC Driver 程序员指南
南大通用数据技术股份有限公司
- 232 -

下表描述了SQLNumParams 的 SQLSTATE 和错误值。
SQLSTATE
错误值
错误消息
01000
-11001
General warning
S1000
-11060
General error
S1001
-11061
Memory-allocation failure
S1008
-11065
Operation canceled
S1010
-11067
Function-sequence error
S1T00
-11094
Time-out expired