Incorrect parameter count in the call to native function 'ISNULL'

1、错误描述

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect parameter count in the call to native function ‘ISNULL‘
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
	at com.mysql.jdbc.Util.getInstance(Util.java:386)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2713)
	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1794)
	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1712)
	at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:225)

1 queries executed, 0 success, 1 errors, 0 warnings

查询:select count(isnull(depart_teacher,‘‘)) from t_depart_info LIMIT 0, 1000

错误代码: 1582
Incorrect parameter count in the call to native function ‘isnull‘

执行耗时   : 0 sec
传送时间   : 0 sec
总耗时      : 0 sec

2、错误原因

MySQL中的ISNULL和IFNULL有区别:

ISNULL只是用来判断是否为空,不能实现替换功能;而IFNULL不仅可以用来判断是否为空,还可以实现替换功能。

3、解决办法

将ISNULL修改成IFNULL

版权声明:本文为博主原创文章,未经博主允许不得转载。

Incorrect parameter count in the call to native function 'ISNULL'

时间: 2024-10-06 10:09:33

Incorrect parameter count in the call to native function 'ISNULL'的相关文章

错误代码: 1582 Incorrect parameter count in the call to native function 'str_to_date'

1. 错误描述 1 queries executed, 0 success, 1 errors, 0 warnings 查询:SELECT t.`name`, DATE_FORMAT(str_to_date('2015'), '%Y') as statisDate, ROUND(IFNULL(SUM(t.`amount`), 0), 3) AS ... 错误代码: 1582 Incorrect parameter count in the call to native function 'str

错误代码 1582 Incorrect parameter count in the call to native f

1. 错误描述 1 queries executed, 0 success, 1 errors, 0 warnings 查询:SELECT t.`name`, DATE_FORMAT(str_to_date('2015'), '%Y') as statisDate, ROUND(IFNULL(SUM(t.`amount`), 0), 3) AS ... 错误代码: 1582 Incorrect parameter count in the call to native function 'str

Incorrect column count: expected 1, actual 5,JdbcTemplate queryForList 出错

spring JdbcTemplate  queryForList 出错 Incorrect column count: expected 1, actual 5 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ?Copyright 蕃薯耀 2017年7月10日 http://www.cnblogs

Adding New Functions to MySQL(User-Defined Function Interface UDF、Native Function)

catalog 1. How to Add New Functions to MySQL 2. Features of the User-Defined Function Interface 3. User-Defined Function 4. UDF Argument Processing 5. UDF Return Values and Error Handling 6. UDF Compiling and Installing 7. Adding a New Native Functio

Java JVM、JNI、Native Function Interface、Create New Process Native Function API Analysis

目录 1. JAVA JVM 2. Java JNI: Java Native Interface 3. Java Create New Process Native Function API Analysis In Linux 4. Java Create New Process Native Function API Analysis In Windows 1. JAVA JVM 0x1: JVM架构简介 JVM是Java Virtual Machine(Java虚拟机)的缩写,JVM是一种

PatentTips – Java native function calling

BACKGROUND OF INVENTION This invention relates to a system and method for providing a native function call facility. In particular it relates to a system and method for providing a native function call facility in a Java Virtual Machine (JVM) for pla

native function 'Window_sendPlatformMessage' (4 arguments) cannot be found

https://github.com/pauldemarco/flutter_blue/issues/140 https://github.com/flutter/flutter/issues/16846 https://github.com/flutter/flutter/issues/26413 大家都碰到了, 试试 https://pub.dartlang.org/packages/flutter_isolate native function 'Window_sendPlatformMe

Incorrect column count: expected 1, actual 4 问题

解释: 期望的结果是1, 实际的结果是 4 ,  对象有4个属性,表有4 个字段 原因: jdbcTemplate.queryForList(selectSql.toString(), entityClass)  : this.jdbcTemplate.queryForObject(sql, SysUser.class); 一  .而  queryForList  方法参数的解释是这样的: Java代码   Parameters: sql SQL query to execute element

mysql 中 isnull 和 ifnull 判断字段是否为null

数据库中经常有字段type为null ,对于统计count(type)和avg(type) 都不起作用 SQL中有ISNULL方法,介绍如下: ISNULL使用指定的替换值替换 NULL. 语法ISNULL ( check_expression , replacement_value ) 参数check_expression将被检查是否为 NULL的表达式.check_expression 可以是任何类型的.replacement_value在 check_expression 为 NULL时将