当前位置:网站首页>GBase8s数据库FOR READ ONLY 子句
GBase8s数据库FOR READ ONLY 子句
2022-06-29 11:28:00 【爱吃萝卜冰冰凉】
FOR READ ONLY 子句
请使用 FOR READ ONLY 关键字来指定为 SELECT 语句声明了的 Select 游标是只读游标。 只
读游标是不可修改数据的游标。此部分提供关于 FOR READ ONLY 子句的下列信息:
您何时必须使用 FOR READ ONLY 子句
对于使用 FOR READ ONLY 子句的 SELECT 语句的语法限制
以只读方式使用 FOR READ ONLY 子句
通常,您无需在 SELECT 语句中包括 FOR READ ONLY 子句。根据定义,SELECT 是只读操
作,因此 FOR READ ONLY 子句通常是没有必要的。然而,在某些环境下,您必须在 SELECT
语句中包括 FOR READ ONLY 关键字。
在符合 ANSI 的数据库中,在缺省情况下,Select 游标是 update 游标。update 游标是可用来修
改数据的游标。这些 update 游标与数据库的只读方式是不兼容的。例如,针对 customer_ansi
表的此 SELECT 语句失败:
EXEC SQL declare ansi_curs cursor for
select * from customer_ansi;
解决方法是在您的 Select 游标中包括 FOR READ ONLY 子句。此子句指定的只读游标与数据库
的只读模式相兼容。例如,下列针对 customer_ansi 表的 SELECT FOR READ ONLY 语句成
功:
EXEC SQL declare ansi_read cursor for
select * from customer_ansi for read only;
DB-Access 以 Select 游标执行所有的 SELECT 语句,因此,您必须在所有访问只读的符合 ANSI
的数据库中数据的查询中指定 FOR READ ONLY。FOR READ ONLY 子句导致 DB-Access 将
SELECT 语句的游标声明为只读游标。
要获取更多关于 0 级备份的信息,请参阅 GBase 8s 备份与恢复指南。要获取关于 Select 游标、
只读游标和 update 游标的信息,请参阅 DECLARE 语句。
与 FOR READ ONLY 子句不兼容的语法
如果您尝试在同一 SELECT 语句中包括 FOR READ ONLY 子句和 FOR UPDATE 子句,则该
SELECT 语句失败。要获取关于为不包括 FOR READ ONLY 子句的 SELECT 语句声明只读游标
的信息,请参阅 DECLARE 语句。
边栏推荐
- 杰理之手动配对方式【篇】
- Helping the ultimate experience, best practice of volcano engine edge computing
- 服务数百万开发者,首届 Techo Day 腾讯技术开放日发布 7 款“轻量级”产品
- 妙!妙盈科技全面实施 Zadig 助力容器化建设,全面拥抱 Kubernetes 和云原生
- 杰理之关于 TWS 交叉配对的配置【篇】
- 文件包含之日志中毒(User-Agent)
- 深入理解 volatile 关键字
- PyTorch学习之归一化层(BatchNorm、LayerNorm、InstanceNorm、GroupNorm)[通俗易懂]
- AOSP ~ 初始化语言
- Jerry's configuration of TWS cross pairing [chapter]
猜你喜欢

Imile uses Zadig's multi cloud environment to deploy thousands of times a week to continuously deliver global business across clouds and regions

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

&4 express框架

又一所“省会大学”,来了!

Wonderful! Miaoying technology fully implements Zadig to help container construction, and fully embraces kubernetes and Yunyuan

leetcode刷题:字符串07(重复的子字符串)

初次使用 eolink 感受

智能垃圾桶(四)——树莓派pico实现超声波测距(HC-SR04)

亲测!Centos7部署PHP + Swoole

win11网页版
随机推荐
2022 question bank and simulation test for documenter post skills (documenter) operation certificate examination
How to obtain method parameter values through WinDbg
Meichuang was selected as one of the first member units of the "business security promotion plan" of the ICT Institute
什么是外链和内链?
在校生的编程故事
Oracle扩充分布式云端服务 为更多客户带来全面公有云服务
SOFARegistry 源码|数据同步模块解析
&4 express框架
Jerry's configuration of TWS cross pairing [chapter]
如何通过WinDbg获取方法参数值
Unified exception reporting practice based on bytecode
将文件夹打包成iso
Object class - the father of ten thousand classes
STM32看门狗研究
2022胺基化工艺考试题模拟考试题库及在线模拟考试
黑化的蜜雪冰城,凭营销就想抓牢消费者的心?
面试突击61:说一下MySQL事务隔离级别?
Ttchat x Zadig open source co creates helm access scenarios, and environmental governance can be done!
[pbootcms template] composition website / document download website source code
二叉树递归与迭代