|ERROR|ERROR: missing data for column "createtime" (seg3 slice1 192.168.66.23:40001 pid=33370)之mysql换行符或者空格引起的问题
1、最近的kettle的数据交换配置,启动kettle引起的错误,如下所示:
|ERROR|ERROR: missing data for column "createtime" (seg3 slice1 192.168.66.23: pid=)
引发这个错误,并不是这个字段引起的错误,一般是这个字段临近的字段存在空格或者换行符引发的错误。
2、引发这个错误,并不是这个字段引起的错误,一般是这个字段临近的字段存在空格或者换行符引发的错误。为了问题重现,我新建一个数据库和数据表:
3、准备插入的正常数据,可以执行多条插入数据:
insert into user(name,age,birthday,sex) VALUES("张三",,"2018-08-20","男");
insert into user(name,age,birthday,sex) VALUES("李四",,"2018-8-20","男");
insert into user(name,age,birthday,sex) VALUES("王五",,"2018-8-20","男");
insert into user(name,age,birthday,sex) VALUES("赵六",,"2018-8-20","男");
insert into user(name,age,birthday,sex) VALUES("李白",,"2018-8-20","男");
insert into user(name,age,birthday,sex) VALUES("安琪拉",,"2018-8-20","女");
insert into user(name,age,birthday,sex) VALUES("亚瑟",,"2018-8-20","男");
insert into user(name,age,birthday,sex) VALUES("鲁班",,"2018-8-20","男");
然后执行查询结果是没有查询结果的:
CONCAT(str1,str2,…) 返回结果为连接参数产生的字符串。

4、然后插入一条换行的数据:
换行的数据可以如下所示造几条,这里造一条。

然后执行
insert into user(name,age,birthday,sex) VALUES("后
裔",14,"2018-8-20","男");
5、然后可以看到已经查询出来了这条换行的数据。

6、mysql函数。replace(string_expression , string_pattern , string_replacement),第一个参数:要查找的字段。第二个参数:要查找的字符。第三个参数:要替换成的字符。char(10)换行键。char(13)回车键。你会发现字段名称like 的concat里面是char(10)和char(13)都可以进行查询出结果的。

7、我要的结果就是将带有换行和回车的字符处理掉,然后执行交换。其他使用情况以后用到再贴。
8、最后说一下,这里是name的字段,本不该出现回车和换行符的,如果是其他长文本字段,可以使用如下命令:
-- 将char()换行键,char()回车键换成@#r;和@#n;
select REPLACE(REPLACE(name, char(), '@#r;'), char(), '@#n;') as name from user where name like CONCAT("%",char(),"%") -- 将@#r;和@#换成nchar()换行键,char()回车键;
select REPLACE(REPLACE(name, '@#r;', char()), '@#n;', char()) as name from user where name like CONCAT("%",char(),"%")
待续......
|ERROR|ERROR: missing data for column "createtime" (seg3 slice1 192.168.66.23:40001 pid=33370)之mysql换行符或者空格引起的问题的更多相关文章
- loadrunner:Action.c(4): Error -27796: Failed to connect to server "192.168.66.3:8080": [10060] Connection timed out
Action.c(4): Error -27796: Failed to connect to server "192.168.66.3:8080": [10060] Connec ...
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length【转】
今天有开发反应他的建表语句错误,我看了下,提示: MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Withou ...
- 插入中文错误ERROR 1406 (22001): Data too long for column 'name' at row 1
1.在导入数据前执行以下命令即可:set SESSION sql_mode=''; 通过设置sql_mode变量更改模式.linux下安装完mysql后,默认的sql-mode值是空,在这种情形下my ...
- MySQL插入中文时出现ERROR 1406 (22001): Data too long for column 'name' at row 1 (转)
使用命令行方式登陆到MySQL服务器, 建立一个数据库,数据库编码设为UTF-8.此时,如果直接在命令行窗口使用insert语句插入中文,就遇到类似 ERROR 1406 (22001): Data ...
- error items-9022:missing required icon file.the bundle does not contain an app icon for iPhone/iPad Touch of exactly '120x120' pixels,in.pen format for ios versions >= 7.0
error items-9022:missing required icon file.the bundle does not contain an app icon for iPhone/iPad ...
- SQL logic error or missing database no such table: xxx
原文:SQL logic error or missing database no such table: xxx System.Data.SQLite.SQLiteException (0x8000 ...
- 如何解决:ERROR: the user data image is used by another emulator. aborting 的问题
问题概述: 在启动Android模拟器时出现以下错误,导致启动失败. ERROR: the user data image is used by another emulator. aborting. ...
- imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 1 extraneous bytes be
imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 1 extraneous bytes be ...
- error on line 1 at column 6: XML declaration allowed only at the start of the document
This page contains the following errors: error on line 1 at column 6: XML declaration allowed only a ...
随机推荐
- yolo
 将目标检测过程设计为为一个回归问题(One Stage Detection),一步到位, 直接从像素到 bbox 坐标和类别概率 优点: 速度快(45fps),效果还不错(mAP 63.4) 利用 ...
- k64 datasheet学习笔记3---Chip Configuration之Times
1.前言 对定时器相关的芯片配置做一概述 2.PDB配置 2.1 PDB介绍 PDB输出触发: PDB输入触发连接: 2.2 PDB模块交互 2.3 back-to-back确认连接 In this ...
- awk输出单引号,双引号【转】
双引号: awk '{print "\""}' #放大:awk '{print " \" "}' 使用“”双引号把一个双引 ...
- 负载均衡集群中的session解决方案【转】
通常面临的问题 从用户端来解释,就是当一个用户第一次访问被负载均衡代理到后端服务器A并登录后,服务器A上保留了用户的登录信息:当用户再次发送请求时, 根据负载均衡策略可能被代理到后端不同的服务器,例如 ...
- MySQL伪master+Binlog+同步【转】
MySQL 中drop 等高危误操作后恢复方法 实验目的: 本次实验以恢复drop操作为例,使用不同方法进行误操作的数据恢复. 方法: 利用master同步 :伪master+Binlog+同步(本文 ...
- 解决64bit不能连接access的问题
原有的程序迁移至64位,结果调用数据库时出错,原因是jet驱动没有64位的,得换用64位的驱动程序: 1. 下载运行 AccessDatabaseEngine_x64.exe (http://ww ...
- 033_linux操作系统火焰图探测系统性能
火焰图是定位疑难杂症的神器,比如 CPU 占用高.内存泄漏等问题.特别是 Lua 级别的火焰图,可以定位到函数和代码级别. 一.研究 https://moonbingbing.gitbooks.io/ ...
- kali sudo apt install 无法定位软件包
在etc/apt 的sources.list 添加镜像源 debhttp://http.kali.org/kali kali-rolling main non-free contrib 或 deb ...
- bootstrap Autocomplete
首先应用文件(已上传到文件,需要可自行下载) <link href="~/bower_components/select2/dist/css/select2.css" rel ...
- Python-HTML转义字符
ISO Latin-1字符集: — 制表符Horizontal tab — 换行Line feed — 回车Carriage Return — Space ! ! — 惊叹号Exclamati ...