search
HomeDatabaseMysql Tutorial类似于split的作用 将字符串, 分隔开成字符数组

也是从一个开源的软件中看到的 就冒昧的拿了出来 PL/SQL split procedure comma_to_arr(list in varchar2, arr out col_head_arr, lenarr out integer) is type col_head_arr is table of varchar2(50) index by binary_integer; l_arr col_head_arr;--字符数

也是从一个开源的软件中看到的 就冒昧的拿了出来

PL/SQL split
 procedure comma_to_arr(list   in varchar2,
                         arr    out col_head_arr,
                         lenarr out integer) is
    type col_head_arr is table of varchar2(50) index by binary_integer;
    l_arr       col_head_arr;--字符数组
    i           integer;--
    str_start   integer;
    arr_counter integer;
  begin
    -- first check if it is null
    --如果为空 就直接返回空的数组 ,标记长度为0
    if length(list) = 0 then
      arr    := l_arr;
      lenarr := 0;
      return;
    end if;
  
    i           := 1;
    str_start   := 1;
    arr_counter := 0;
    --循环条件 字符扫描位置小于字符长度+1
    while i <= length(list) + 1 loop
      --如果字符长度大于 字符长度 或者是 字符串的第i位是i
      if i > length(list) or substr(list, i, 1) = ',' then
        --要数组长度递增
        arr_counter := arr_counter + 1;
        --将 浮标位置开始 以及到 ,之间的 字符保存
        l_arr(arr_counter) := substr(list, str_start, i - str_start);
        --将浮标 设定为,后的下一个字符 
        str_start := i + 1;
      end if;
      --移动 字符扫描位置
      i := i + 1;
    end loop;
    arr    := l_arr;
    lenarr := arr_counter;
  end;
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
触摸键盘在win11中的功能和用途触摸键盘在win11中的功能和用途Jan 03, 2024 pm 04:40 PM

我们在浏览win11设置的时候,可能发现其中有一个触摸键盘设置,但是我们屏幕也不支持触屏,那么这个win11触摸键盘到底有什么用呢,其实它就是屏幕键盘。win11触摸键盘的作用:1、win11触摸键盘其实就是“屏幕键盘”2、它可以模拟真实键盘,通过点击的方式来使用键盘。3、当我们没有键盘或是键盘坏了的时候,就可以使用它来打字。4、win11为触摸键盘提供了丰富的个性化选项。5、其中包括了各种颜色、主题,能够让用户自由切换喜欢的风格。6、点击左上角“齿轮”还能修改键盘布局、手写等输入方式。

深入了解Gunicorn的基本原理和功能深入了解Gunicorn的基本原理和功能Jan 03, 2024 am 08:41 AM

Gunicorn的基本概念和作用Gunicorn是一个用于在PythonWeb应用程序中运行WSGI服务器的工具。WSGI(Web服务器网关接口)是Python语言定义的一种规范,用于定义Web服务器与Web应用程序之间的通信接口。Gunicorn通过实现WSGI规范,使得PythonWeb应用程序可以被部署和运行在生产环境中。Gunicorn的作用是作

Java String中的split方法如何使用Java String中的split方法如何使用May 02, 2023 am 09:37 AM

String中split方法使用String的split()方法用于按传入的字符或字符串对String进行拆分,返回拆分之后的数组。1、一般用法用一般的字符,例如@或,等符号做分隔符时:Stringaddress="上海@上海市@闵行区@吴中路";String[]splitAddr=address.split("@");System.out.println(splitAddr[0]+splitAddr[1]+splitAddr[2]+splitAddr[3

光盘驱动程序的功能和用途说明光盘驱动程序的功能和用途说明Dec 30, 2023 pm 06:37 PM

对于使用电脑的朋友来说,系统驱动是一个很熟悉的概念,也可能自己安装过驱动程序。但是,对于系统驱动光盘的作用,有些人可能并不清楚。实际上,系统驱动光盘是一个非常方便的驱动安装工具。下面,我将为大家详细介绍一下它的作用。系统驱动光盘通常随着电脑或硬件设备一起提供。它包含了硬件设备所需的驱动程序和软件。当我们需要安装一个新的硬件设备时,可以使用系统驱动光盘来快速安装所需的驱动程序。这些驱动程序可以使硬件设备正常工作,并与操作系统进行良好的兼容。使用系统驱动光盘安装驱动程序非常简单。首先,我们需要将光盘

mac地址的作用是什么mac地址的作用是什么Dec 10, 2020 am 10:07 AM

mac地址的作用是标识具体的网络节点。MAC地址是一个用来确认网络设备位置的位址,mac地址在一定程度上与硬件一致,是基于物理的。计算机之间进行通信时,数据包在节点之间的传递都是由地址解析协议负责将IP地址映射到MAC地址上来的。

PHP中endwhile关键字的作用和示例PHP中endwhile关键字的作用和示例Jun 28, 2023 pm 08:00 PM

PHP中endwhile关键字的作用和示例在PHP中,endwhile是一种控制结构,用来实现while循环。它的作用是让程序在满足指定条件的情况下,重复执行一段代码块,直到条件不再满足。endwhile的语法形式如下:while(condition)://循环体代码endwhile;在这个语法中,condition是一个逻辑表达式,当该表达

如何解决 golang 中的 “undefined: bytes.Split” 错误?如何解决 golang 中的 “undefined: bytes.Split” 错误?Jun 25, 2023 pm 02:02 PM

在Go语言中,bytes包是一个用于操作字节类型的包,并且它包含了许多有用的方法,比如Split()方法。不过,在使用Split()方法时,你可能会遇到“undefined:bytes.Split”的错误。这种错误通常是由于Go版本不兼容或缺少必要的依赖库等原因引起的。这篇文章将介绍一些解决这种错误的方法。方法一:升级Go版本如

split在python中的用法split在python中的用法Nov 17, 2023 am 10:13 AM

在Python中,split() 是一个常用的字符串方法,用于将字符串分割成子字符串,并返回一个包含这些子字符串的列表。该方法可以根据指定的分隔符将字符串拆分成多个部分。其基本语法是“str.split(separator, maxsplit)”,str是要分割的字符串,separator是分隔符,maxsplit是可选参数,表示最大分割次数。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool