ALTER FOREIGN TABLE (导入导出)
功能描述
用于对外表进行修改。
注意事项
无。
语法格式
- 设置外表属性
1 2
ALTER FOREIGN TABLE [ IF EXISTS ] table_name OPTIONS ( {[ ADD | SET | DROP ] option ['value']}[, ... ]);
- 设置新的所有者
1 2
ALTER FOREIGN TABLE [ IF EXISTS ] tablename OWNER TO new_owner;
参数说明
- table_name
需要修改的外表名称。
取值范围:已存在的外表名。
- option
需要修改的option名称。
取值范围:请参见CREATE FOREIGN TABLE的参数说明。
- value
option的新值。
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | --创建外部表。 CREATE FOREIGN TABLE tpcds.customer_ft ( c_customer_sk integer , c_customer_id char(16) , c_current_cdemo_sk integer , c_current_hdemo_sk integer , c_current_addr_sk integer , c_first_shipto_date_sk integer , c_first_sales_date_sk integer , c_salutation char(10) , c_first_name char(20) , c_last_name char(30) , c_preferred_cust_flag char(1) , c_birth_day integer , c_birth_month integer , c_birth_year integer , c_birth_country varchar(20) , c_login char(13) , c_email_address char(50) , c_last_review_date char(10) ) SERVER gsmpp_server OPTIONS ( location 'gsfs://10.185.179.143:5000/customer1*.dat', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', mode 'Normal') READ ONLY; --修改外表属性,删除mode选项。 ALTER FOREIGN TABLE tpcds.customer_ft options(drop mode); --删除外部表。 DROP FOREIGN TABLE tpcds.customer_ft; |
相关链接
CREATE FOREIGN TABLE (导入导出),DROP FOREIGN TABLE
查看更多:华为GaussDB 200 SQL语法
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




