SQLSTATE [HY010]:函数序列错误:插入期间为0 [英] SQLSTATE[HY010]: Function sequence error: 0 during insert

查看:842
本文介绍了SQLSTATE [HY010]:函数序列错误:插入期间为0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个非常简单的插入查询中,将PDO与ODBC驱动程序一起用于DB2数据库,该驱动程序将返回以下错误:

During a very simple insert query, using PDO with an ODBC driver for a DB2 database, the driver returns the following error:

SQLSTATE[HY010]: Function sequence error: 0 [Microsoft][Driver Manager ODBC] [italian message translation] (SQLExecute[0] at ext\pdo_odbc\odbc_stmt.c:254)

查询本身是带有字符串和日期的预准备语句插入. [意大利语消息翻译]只是用意大利语说功能序列错误".

The query itself is a prepared statement insert, with strings and dates. [italian message translation] just says "Function sequence error" in italian.

此SO问题报告了相同的问题,但发生在SELECT查询期间,这不是我的情况 此PHP错误报告报告了相同的问题,但我确定不是还是我的情况.

This SO question reports the same problem, but occurred during a SELECT query, which is not my case This PHP bug report reports the same problem, but I've determined that's not my case either.

为什么简单的插入会导致SQLSTATE [HY010]导致函数序列错误?

Why does a simple insert cause a function sequence error with SQLSTATE[HY010]?

推荐答案

PHP读取错误报告,用户报告该问题与插入日期的格式有关,因为(在这种情况下)它缺少月份数中的一些数字.

Reading from the PHP bug report, users have reported that the issue is related to the format of the date being inserted, because (in that particular case) it was missing some digits from the months number.

这让我想到:也许某些输入数据的长度与表列不兼容.实际上,我写的是80个字符,只能容纳60个字符.

That made me think: maybe the length of some input data was incompatible with the table column. In fact, I was writing 80 characters where only 60 could fit.

检查您的输入值:长度,格式和类型.其中之一可能与您要写入的列不兼容.我希望从驱动程序发出的不同消息是诚实的(在我的情况下,数据将被截断),因为如果您拥有更好的信息,就不会很难解决问题.

Check your input values: length, format and type. One of these may be incompatible with the column you're writing into. I'd expect a different message from the driver to be honest (data truncated in my case), because the problem isn't too hard to solve if you have better information.

只要我将输入长度减小到允许的最大值以下,查询就会成功执行

As soon as I reduced the input length below the maximum value allowed, the query executed successfully

这篇关于SQLSTATE [HY010]:函数序列错误:插入期间为0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆