当前位置:网站首页>GBase8s数据库INTO table 子句
GBase8s数据库INTO table 子句
2022-06-29 11:27:00 【爱吃萝卜冰冰凉】
I使用 INTO Table 子句来创建新的临时的、永久的或外部的表来接收 SELECT 语句检索的数据;
您必须对要在其上创建临时的、永久的或外部表的数据库有 Connect 权限。在其他用户会话中的临
时表的标识符之中,临时表的名称无需是唯一的。
在 Projection 子句中,必须指定在永久的、临时的或外部表中的列名称,在此,您必须为不是简单
的列表达式的所有表达式提供显示标签。该显示标签成为在永久的、临时的或外部表中的列名称。
如果您没有为简单的列表达式声明显示标签,则产生的新表使用 Projection 子句的选择列表中的列
名称。
下列 INTO TEMP 示例创建 pushdate 表,带有两个列 customer_num 和 slowdate:
SELECT customer_num, call_dtime + 5 UNITS DAY slowdate
FROM cust_calls INTO TEMP pushdate;
下列 INTO STANDARD 示例创建 stab1 表,带有两列 fcol1 和 col2:
SELECT col1::FLOAT fcol1, col2
FROM tab1 INTO STANDARD stab1;
在此,col1 是该查询从其检索数据的 tab1 表中的 INTEGER 列,但 fcol1 值在产生的 stab1 表
中被强制转型为 FLOAT。省略 STANDARD 关键字的查询会创建相同的结果表,因为
STANDARD 是缺省的表类型。
当没有返回行时的结果
当您使用与 WHERE 子句组合的 INTO Table 子句时,且没有返回行,则 SQLNOTFOUND 值在
符合 ANSI 的数据库中是 100,在不符合 ANSI 的数据库中是 0。如果 SELECT INTO
TEMP…WHERE… 语句是多语句 PREPARE 的一部分,且没有返回行,则对于符合 ANSI 的数
据库和不符合 ANSI 的数据库,SQLNOTFOUND 值都是 100。
此 GBase 8s 版本在遇到 SQLNOTFOUND 值 100 之后,继续处理多语句准备好的对象的剩余的
语句。然而,您可维持传统的行为,通过将 IFX_MULTIPREPSTMT 环境变量设置为 1,不执行剩
余的准备好的语句。
对 ESQL/C 中的 INTO table 子句的限制
在 GBase 8s ESQL/C 中,请不要在同一查询中同时使用 INTO table 子句与 INTO variable 子句。
如果您同时使用,则不会向程序变量返回结果,且将 SQLCODE 变量设置为负值。要获取更多关
于 INTO variable 子句的信息,请参阅 INTO 子句。
边栏推荐
- ESP8266简介:三种编程方式「建议收藏」
- SOFARegistry 源码|数据同步模块解析
- 每周推荐短视频:爱因斯坦是怎样思考问题的?
- 开源机器学习平台
- Matlab GUI realizes the function of clicking the button, opening the file dialog box and importing pictures
- iMile 利用 Zadig 多云环境周部署千次,跨云跨地域持续交付全球业务
- 合约量化交易系统玩法开发 (现成案例分析)
- Is it safe for Hengtai securities to open an account? Ranking of securities
- & 4 express framework
- seekg ()[通俗易懂]
猜你喜欢

Pytoch - distributed communication primitive (with source code)

&3 在浏览器中查看请求报文和响应报文

【文献翻译】Concealed Object Detection(伪装目标检测)

如何查看网站已经保存的密码

Sofaregistry source code | data synchronization module analysis
![[VTK] MFC grid editor based on vtk8.2](/img/c5/d0f070ccb819fc682855319b7415e0.png)
[VTK] MFC grid editor based on vtk8.2
![Jerry's about TWS channel configuration [chapter]](/img/2c/58a49dea7a7931c4d1f055548c2493.png)
Jerry's about TWS channel configuration [chapter]

Oracle netsuite helps TCM bio understand data changes and make business development more flexible

Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?

杰理之关于 TWS 交叉配对的配置【篇】
随机推荐
torch. Load load model error: can't get attribute 'VAE_ vc‘ on <module ‘__ main__‘ From 'xxxx() run file path‘
Meichuang was selected as one of the first member units of the "business security promotion plan" of the ICT Institute
Jerry's about TWS pairing mode configuration [chapter]
Oracle netsuite helps TCM bio understand data changes and make business development more flexible
易快报:我们用 Zadig 实现万次构建部署,聪明运维,释放开发生产力
2022 amination process test question simulation test question bank and online simulation test
How to obtain method parameter values through WinDbg
龙书虎书鲸书啃不动?试试豆瓣评分9.5的猴书
[pbootcms template] composition website / document download website source code
助力极致体验,火山引擎边缘计算最佳实践
小白学习MySQL - 增量统计SQL的需求 - 开窗函数的方案
启泰观察:职业精英创业必踩巨坑之 --- 学习效果坑
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
[pbootcms模板]作文网站/文档下载网站源码
Oracle NetSuite 助力 TCM Bio,洞悉数据变化,让业务发展更灵活
[VTK] MFC grid editor based on vtk8.2
Sofaregistry source code | data synchronization module analysis
Wonderful! Miaoying technology fully implements Zadig to help container construction, and fully embraces kubernetes and Yunyuan
Pro test! Centos7 deploy PHP + spool
【文献翻译】Concealed Object Detection(伪装目标检测)