Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

MySQLSyntaxErrorException: Result consisted of more than one row

Hi,
Getting error while loading data into mysql tables.
I have n number of records to load and update 8 different tables.
From source I am getting 10000 records. I am using procedures to update 8 different tables.
Error:
Exception in component tMysqlSP_1
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Result consisted of more than one row
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:353)
at com.mysql.jdbc.Util.getInstance(Util.java:336)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1031)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2938)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1601)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1710)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2436)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1402)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:977)
at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:851)

Please help me to solve this.
Thanks
Chin
Labels (4)
6 Replies
janhess
Creator II
Creator II

Are you doing it all in one statement?
Anonymous
Not applicable
Author

Hi,
No. Based on the condition I am calling 7 different procedures in main.
janhess
Creator II
Creator II

Can you post the job.
Anonymous
Not applicable
Author

Hi,
I am using procedures
CREATE DEFINER=`MAIN`@`LOCALHOST` PROCEDURE `TESTPROC`(C_ID INT,INEMPCODE VARCHAR(2))
BEGIN
DECLARE TEST1 INT;
SELECT DISTINCT COL1
IF(trim(EMP_CODE)null,trim(EMP_CODE)) as EMP_CODE
......
INTO TEST1
FROM WHERE CONDITION1='A' AND CONDITION2=C_ID

SELECT CONDITION2,....

INTO LLCONDITION2 WHERE CONDITION1='A'

IF (LLCONDITION2 IS NOT NULL) THEN
UPDATE SET ...
.....
WHERE CONDITION2=LLCONDITION2

CALL PROC1(C_ID,LLCONDITION2)
CALL PROC2(C_ID,LLCONDITION2)
CALL PROC3(C_ID,LLCONDITION2)
............
.............
ELSEIF (LLCONDITION2 IS NULL) THEN
INSERT INTO ....
VALUES(,...)

CALL PROC1(C_ID,LLCONDITION2)
CALL PROC2(C_ID,LLCONDITION2)
CALL PROC3(C_ID,LLCONDITION2)
............
.............
ENDIF
END
janhess
Creator II
Creator II

So your problem is in there somewhere. It's a sql fault.
Anonymous
Not applicable
Author

This happens if a subquery returns more than one row. Subqueries are not allowed to return more than one row.