专门做网站开发的公司/seo优化中以下说法正确的是
文章目录
- 背景
- 集合类型
- 可变数组
- 可变数组示例
背景
在信创适配中,从Oracle迁移过来的存储过程使用到可变数组。因此在LightDB-X 23.4版本中对现有的集合类型进行了增强,添加了可变数组类型。
集合类型
在LightDB-X 23.4版本开始plorasql支持的集合类型同Oracle一致,覆盖了关联数组,可变数组和嵌套表三种类型,支持的方法如下
- DELETE 从集合中删除元素。
- EXTEND 将元素添加到集合的末尾。
- EXISTS 如果集合的指定元素存在,则返回TRUE。
- FIRST 返回集合中的第一个索引。
- LAST 返回集合中的最后一个索引。
- COUNT 返回集合中的元素数量。
可变数组
可变大小数组是一个数组,其元素数量可以从零(空)到声明的最大大小不等,在这里超过也支持。
要访问可变数组的元素,使用语法variable_name(index)。在数据库中存储和检索可变数组时,其索引和元素顺序将保持稳定。
随着您添加或删除元素,可变数组变量占用的内存量可以动态增加或减少。
目前只支持本地类型的可变数组,不支持全局可变数组。
可变数组示例
准备数据
select dbms_output.serveroutput(true);
create table user_info(id int, name varchar(30));
insert into user_info values( 11, 'zhangsan');
insert into user_info values( 21, 'lisi');
insert into user_info values( 31, 'wangwu');
匿名块
declaretype id_array is varray(10) of INTEGER;ids id_array := id_array(11, 21);v_name varchar2(30);
beginif ids.exists(3) thendbms_output.put_line('ids(3) exists.');elsedbms_output.put_line('ids(3) not exists.');end if;ids.extend;ids(ids.count) := 31;if ids.exists(3) thendbms_output.put_line('ids(3) exists.');elsedbms_output.put_line('ids(3) not exists.');end if;dbms_output.put_line('count=' || ids.count);for i in ids.first .. ids.last loopselect name into v_name from user_info where id = ids(i);dbms_output.put_line('ids(' || i || ') name is ' || v_name);end loop;ids.delete;dbms_output.put_line('after is.delete, count=' || ids.count);
end;
/ids(3) not exists.
ids(3) exists.
count=3
ids(1) name is zhangsan
ids(2) name is lisi
ids(3) name is wangwu
after is.delete, count=0
DO
函数
create or replace function f_varray() return int istype id_array is varray(10) of INTEGER;ids id_array := id_array(11, 21);v_name varchar2(30);
beginif ids.exists(3) thendbms_output.put_line('ids(3) exists.');elsedbms_output.put_line('ids(3) not exists.');end if;ids.extend;ids(ids.count) := 31;if ids.exists(3) thendbms_output.put_line('ids(3) exists.');elsedbms_output.put_line('ids(3) not exists.');end if;dbms_output.put_line('count=' || ids.count);for i in ids.first .. ids.last loopselect name into v_name from user_info where id = ids(i);dbms_output.put_line('ids(' || i || ') name is ' || v_name);end loop;ids.delete;dbms_output.put_line('after is.delete, count=' || ids.count);return ids.count;
end;
/select f_varray();ids(3) not exists.
ids(3) exists.
count=3
ids(1) name is zhangsan
ids(2) name is lisi
ids(3) name is wangwu
after is.delete, count=0f_varray
----------0
(1 row)
存储过程
create or replace procedure p_varray() istype id_array is varray(10) of INTEGER;ids id_array := id_array(11, 21);v_name varchar2(30);
beginif ids.exists(3) thendbms_output.put_line('ids(3) exists.');elsedbms_output.put_line('ids(3) not exists.');end if;ids.extend;ids(ids.count) := 31;if ids.exists(3) thendbms_output.put_line('ids(3) exists.');elsedbms_output.put_line('ids(3) not exists.');end if;dbms_output.put_line('count=' || ids.count);for i in ids.first .. ids.last loopselect name into v_name from user_info where id = ids(i);dbms_output.put_line('ids(' || i || ') name is ' || v_name);end loop;ids.delete;dbms_output.put_line('after is.delete, count=' || ids.count);
end;
/call p_varray();ids(3) not exists.
ids(3) exists.
count=3
ids(1) name is zhangsan
ids(2) name is lisi
ids(3) name is wangwu
after is.delete, count=0
CALL
相关文章:

lightdb plorasql集合类型新增可变数组
文章目录 背景集合类型可变数组可变数组示例 背景 在信创适配中,从Oracle迁移过来的存储过程使用到可变数组。因此在LightDB-X 23.4版本中对现有的集合类型进行了增强,添加了可变数组类型。 集合类型 在LightDB-X 23.4版本开始plorasql支持的集合类型…...

算法--最短路
这里写目录标题 xmind单源最短路简介所有边权都是正朴素的Dijkstra算法思想例子题解 堆优化版的Dijkstra算法 存在负数权Bellman-Ford算法思想例子题解 spfa算法思想例子题解 spfa判断负环思想例子题解 多源汇最短路简介弗洛伊德算法思想例子题解 小tips xmind 上述中ÿ…...

Linux 定时任务备份MySQL数据库
Linux 定时任务基本知识 crontab yum install crontabs (安装 crontabs) systemctl enable crond (设为开机启动) systemctl start crond(启动crond服务) systemctl status crond (查看状态&a…...

查询服务器CPU、内存、磁盘、网络IO、队列、数据库占用空间等等信息
文章目录 摘要1. 查询CPU使用率命令:top -bn1 | grep \"Cpu(s)\" | awk {split($0,arr,\" \");print 100-arr[8]}2. 查询内存命令(单位:G):top -bn1 | grep \"KiB Mem\" | awk {split($…...

外观模式 rust和java的实现
文章目录 外观模式介绍实现javarustrust仓库 外观模式 外观模式(Facade Pattern)隐藏系统的复杂性,它为子系统中的一组接口提供一个统一的高层接口,使得这些接口更加容易使用。外观模式通过封装子系统内部的复杂性,提…...

uniapp-hubildx配置
1.配置浏览器 (1)运行》运行到浏览器配置》配置web服务器 (2)选择浏览器安装路径 (3)浏览器安装路径: (3.1) 右键点击图标》属性 (3.2)选择目标&…...

Nginx基础篇:Nginx搭建、Nginx反向代理、文件服务器部署配置。
Nginx Linux系统安装以及反向代理的配置 简介优点nginx 环境安装常用Nginx 命令nginx 文件服务器搭建 简介 Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务。Nginx是由伊戈尔赛索耶夫为俄罗斯访问量第二的Rambler.ru站点…...

什么是TDR(威胁检测与响应)
网络安全是被动和主动方法的混合体。过去,企业往往局限于被动的方法,随着合规性和安全策略越来越受到重视,主动方法也越来越受到关注。与其他行业相比,网络安全是高度动态的,网络安全团队采用任何可以帮助他们优化的新…...

30、pytest入门内容回顾
整体结构 解读与实操 pytest30讲主要从四个方面由浅入深的进行解读, 开始 讲解了pytest的概述,安装前的准备工作(python,pycharm,pytest),运行方式(命令行),断言(assert…...

2023年 - 我的程序员之旅和成长故事
2023年 - 我的程序员之旅和成长故事 🔥 1.前言 大家好,我是Leo哥🫣🫣🫣,今天咱们不聊技术,聊聊我自己,聊聊我从2023年年初到现在的一些经历和故事,我也很愿意我的故事分…...

JMH性能测试
一、JMH JMH,全称Java Microbenchmark Harness(微基准测试框架),是专门用于Java代码微基准测试的一套测试工具API,是由Java虚拟机团队开发的,一般用于代码的性能调优。 BenchMark又叫做基准测试,…...

超完整的mysql安装配置方法(包含idea和navicat连接mysql,并实现建表)
mysql安装配置方法 1、下载mysql2、解压到指定的安装目录3、配置初始化文件my.ini4、配置用户变量和系统变量5、初始化mysql6、安装mysql服务并启动修改密码7、使用idea连接mysql8、使用Navicat可视化工具连接mysql,并实现新建数据库,新建表 1、下载mysq…...

通过仿真理解完整的阵列信号噪声模型
概要 噪声对无线电设备的信号接收会造成影响,是通信、雷达、导航、遥感等工程应用领域中的关键考虑因素。通常认为阵列合成能够提升信噪比,但忽略了这一论断的前提,即不同通道引入的噪声互不相关。但实际应用中,接收的噪声不仅仅包含信道引入的不相关噪声,还包含从外界环…...

问题:数组对象去重
问题:数组对象去重 var arr [{name: ‘a’,id: 1}, {name: ‘a’,id: 2}, {name: ‘b’,id: 3}, {name: ‘c’,id: 4}, {name: ‘c’,id: 6}, {name: ‘b’,id: 6}, {name: ‘d’,id: 7}]; 对数组对象name进行去重处理, 结果显示为: [{name…...

前端:让一个div悬浮在另一个div之上
使用 CSS 的 position 属性和 z-index 属性 首先,将第二个 div 元素的 position 属性设为 relative 或 absolute。这样可以让该元素成为一个定位元素,使得后代元素可以相对于它进行定位。 然后,将要悬浮的 div 元素的 position 属性设为 ab…...

千锋 Vue 详细笔记整理
视频笔记是根据B站 千锋 涛哥 - SpringBootvue前后端分离项目《锋迷商城》实战课-完结版 进行整理的 笔记可上 gitee仓库 自取 千锋 Vue 笔记整理 一、vue 的简介1.1 使用 JQuery 的复杂性问题1.2 VUE 简介1.2.1 前端框架1.2.2 MVVM 二、 vue 入门使用2.1 vue 的引入2.2 入门案…...

uniapp实战 —— 骨架屏
1. 自动生成骨架屏代码 在微信开发者工具中,预览界面点击生成骨架屏 确定后,会自动打开骨架屏代码文件 pages\index\index.skeleton.wxml 2. 将骨架屏代码转换为vue文件 在项目中新建文件 src\pages\index\components\skeleton.vue 将pages\index\index…...

【数据仓库-10】-- 数据仓库、数据湖和湖仓一体对比
目录 1 数据仓库与数据库的对比 2 数据湖与数据仓库的对比 3 数据仓库、数据湖和湖仓一体...

单臂路由与三层交换机
单臂路由 划分VLAN后同一VLAN的计算机属于同一个广播域,同一VLAN的计算机之间的通信是不成问题的。然而,处于不同VLAN的计算机即使是在同一交换机上,它们之间的通信也必须使用路由器。 图(a)是一种实现VLAN间路由的方…...

免费的数据采集软件,最新免费的几款数据采集软件【2024】
在当今数字化时代,数据是企业决策和业务发展的关键。而如何高效获取数据成为许多企业和研究机构的关注焦点。本文将深入探讨数据采集软件的种类。帮助大家选择最适合自己需求的数据采集工具。 数据采集软件种类 在众多数据采集软件中,有一类强大而多样…...

nodejs微信小程序+python+PHP北京地铁票务APP-计算机毕业设计推荐 -安卓
目 录 摘 要 I ABSTRACT II 目 录 II 第1章 绪论 1 1.1背景及意义 1 1.2 国内外研究概况 1 1.3 研究的内容 1 第2章 相关技术 3 2.1 nodejs简介 4 2.2 express框架介绍 6 2.4 MySQL数据库 4 第3章 系统分析 5 3.1 需求分析 5 3.2 系统可行性分析 5 3.2.1技术可行性:…...

zabbix 进阶
zabbix的字段发现机制: zabbix客户端主动和服务端联系,将自己的地址和端口发送服务端实现字段添加监控主机。 客户端是主动一方。 缺点:自定义网段中主机数量太多,登记耗时会很久,而且这个自动发现机制不是很稳定。…...

【性能测试】Jmeter 配置元件(一):计数器
Jmeter 配置元件(一):计数器 在 Jmeter 中,通过函数 ${__counter(,)} 可以实现每次加 1 1 1 的计数效果。但如果步长不为 1 1 1,则要利用到我们的计数器。 函数作用${__counter(,)}计数器,每次加 1${__d…...

使用Dockerfile Maven Plugin 将Docker镜像Push到AWS ECR (Elastic Container Registry)
文章目录 小结问题解决AWS ECR (Elastic Container Registry)的登录问题 pull access denied for jdk, repository does not exist问题 Could not acquire image ID or digest following builddockerfile-maven-plugin 使用 参考 小结 本文记录使用Dockerfile Maven Plugin 将…...

ubuntu 20.04.6 server 服务器 下载与安装(配置静态IP)
下载地址:https://releases.ubuntu.com/20.04.6/ubuntu-20.04.6-live-server-amd64.iso 第一步: 准备U盘,使用软碟通将下载好的镜像写入到U盘中 软碟通网址:https://www.cn.ultraiso.net/xiazai.html 点击:文件 ->…...

[Linux] Apache的配置与运用
一、web虚拟主机的构台服务器上运行多个网站,每个网站实际上并不独立占用整个服务器,因此称为"虚拟"虚拟主机的虚拟主机服务可以让您充分利用服务器的硬件资源,大大降低了建立和运营网站的成本 Httpd服务使构建虚拟主机服务器变得容…...

PHP基础 - 注释变量
一. 语言开始标识 在PHP中,文件的开头需要使用语言开始标识来指定该文件是PHP代码。标识通常为"<?php",也可以是"<?",但建议使用"<?php"以确保代码的兼容性和可读性。 <?php // PHP代码从这里开始写 二. PHP注释 注释是用…...

【图论笔记】克鲁斯卡尔算法(Kruskal)求最小生成树
【图论笔记】克鲁斯卡尔算法(Kruskal)求最小生成树 适用于 克鲁斯卡尔适合用来求边比较稀疏的图的最小生成树 简记: 将边按照升序排序,选取n-1条边,连通n个顶点。 添加一条边的时候,如何判断能不能添加…...

oops-framework框架 之 多语言设置文本、精灵和骨骼动画
引擎: CocosCreator 3.8.0 环境: Mac Gitee: oops-plugin-excel-to-json 注: 作者dgflash的oops-framework框架QQ群: 628575875 简介 作者dgflash在oops-framework的框架中提供了多语言,主要用于对文本、图片、骨骼动…...

阿里云SLB的使用总结
一、什么是SLB 实现k8s的服务service的一种推荐方式,也是服务上云后,替代LVS的一个必选产品。 那么它有什么作用呢? 1、负载均衡,是它与生俱来的。可以配置多个服务器组:包括虚拟服务器组、默认服务器组、主备服务器…...