`
weigang.gao
  • 浏览: 470206 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

to_single_byte

阅读更多
在很多软件系统中,并没有对非法输入进行处理;将半角数值输入为全角数值的情况很常见(本来应该只能输入半角数值,但是你输入全角字符了)。在存储的时候,一个半角数字占1个byte,但是一个全角数字需要占3个byte
因为全角的原因,原本定义的字段长度很容易出现长度不够的情况

可以使用oralce的内置函数to_single_byte来转换一下,使用这个函数会将全角字符转换为半角的字符,对于半角的字符不做处理

select to_single_byte('gaoweigang222') from dual
--结果:gaoweigang222 而不是gaoweigang222
分享到:
评论

相关推荐

    信息安全_数据安全_Single byte write to RCE:exploit.pdf

    信息安全_数据安全_Single byte write to RCE:exploit 安全实践 信息安全 安全防御 云安全 安全体系

    a_byte_of_python

    Single Statement Blocks List Comprehension Using List Comprehensions Receiving Tuples and Lists in Functions Lambda Forms Using Lambda Forms The exec and eval statements The assert statement ...

    Oracle8i_9i数据库基础

    第一部分 Oracle SQL*PLUS基础 23 第一章 Oracle数据库基础 23 §1.1 理解关系数据库系统(RDBMS) 23 §1.1.1 关系模型 23 §1.1.2 Codd十二法则 24 §1.2 关系数据库系统(RDBMS)的组成 24 §1.2.1 RDBMS 内核 24...

    Oracle全角数字转换半角数字

    数据库表 test 字段 id name age 全角数字:1234 半角数字:1234 length和lengthb的区别: length(1234) 4 ... update test t1 set t1.age = (select to_single_byte(t2.age) from test t2

    Byte4ToSingle.rar

    VB调用C的dll库实例,4字节转为1个实数,用于通讯数值转换

    4BYTE转换成float型代码

    4BYTE字节转换成float型数据代码

    stm32 mpu_6050程序

    void I2C_SendByte(u8 SendByte) ; unsigned char I2C_RadeByte(void); void READ_MPU6050(void); u8 Single_Write(unsigned char SlaveAddress,unsigned char REG_Address,unsigned char REG_data); void GPIO_...

    msp430 C语言例程

    msp430x261x_dma_11_IAR.c - (Built with IAR) DMA0/1, ADC12 A10 rpt single transfer Xfer to MPY/RAM, TBCCR1, DCO DMA0/1, Block Mode UART1 9600 Auto RX/TX String, ACLK Flash In-System Programming, Copy ...

    一个win32下的ARM开源编译器

    ARM processors and coprocessors up to and including v8. Contents: 1. ARM assembly compatibility 2. UAL and pre-UAL syntaxes 3. IT block handling 4. Alternate encodings 5. Output formats ...

    stupidArtnet:(非常)简单的Python artnet库

    # YOU CAN CREATE YOUR OWN BYTE ARRAY OF PACKET_SIZE packet = bytearray(packet_size) for i in range(packet_size): packet[i] = (i %6) # ... AND SET IT TO STUPID ARTNET a.set(packet) # YOU CAN CHANGE ...

    linux全志R16的linux系统编译的资料_20170502_1655.7z

    全志R16平台编译linux系统V1.0.txt 2017/4/11 13:36 (编译请使用编译android的lichee的选项编译生成的.config文件,不然直接编译会报错!!...rootroot@cm-System-Product-Name:/home/...Preparing to unpack ......

    Programming Language C++, Library Working Group

     Removed functions to convert from span<byte> to span<T> as they are not compatible with type aliasing rules.  Introduced dependency on P0257 [6] for definition of byte type, in order to support ...

    一份修補執行檔的文章 有指令 教學

    What if I want to everything in single line od -An -t x1 -v a.out | tr -d '\n' How to convert continuous space in text file into single one od -An -t x1 -v a.out | tr -d '\n' | tr -s ' ' > a.txt How ...

    7Zip lzma LZ4 fastlz and Zip Multiplatform Plugin v2.7.5

    This is a shared library for Android, iOS, OSX, ...- Ability to decode/encode a byte buffer to/from the lzma alone format. - Ability to cancel the decompression when the 7z archive has multiple entries.

    Python如何读写字节数据

    # Read the entire file as a single byte string with open('somefile.bin', 'rb') as f: data = f.read() # Write binary data to a file with open('somefile.bin', 'wb') as f: f.write(b'Hello World') 在...

    VB BytesToFloat

    vb字节转浮点数的例程,可以直接使用. Private Sub Command1_Click() ...Dim BB(0 To 3) As Byte Dim se As Single BB(0) = Text1.Text BB(1) = Text2.Text BB(2) = Text3.Text BB(3) = Text4.Text

    S50 7字节UID 改为随机UID

    3. UIDF2: anti-collision and selection with a single size random ID according to ISO/IEC 14443-3 4. UIDF3: anti-collision and selection with a single size NUID according to ISO/IEC 14443-3 where the ...

    HV892液体镜头Lens驱动

    A single byte (AMP) written to the HV892 controls the operation of the driver. Setting AMP = 01h to FFh controls output amplitude in 255 monotonic steps. Setting AMP = 00h causes the HV892 to go into ...

    MX25L6406E, 3V, 64Mb, v1.8

    • Single Power Supply Operation - 2.7 to 3.6 volt for read, erase, and program operations • Serial Peripheral Interface compatible -- Mode 0 and Mode 3 • 67,108,864 x 1 bit structure or 33,554,432 ...

    366b_q_z00m_8dp_mobile_lpddr4x.pdf

    • Bidirectional/differential data strobe per byte lane • Programmable READ and WRITE latencies (RL/WL) • Programmable and on-the-fly burst lengths (BL = 16, 32) • Directed per-bank refresh for ...

Global site tag (gtag.js) - Google Analytics