Skip to main content
adrianh4955335
Participant
Jan 19, 2016 2:06 AM UTC
Question

Multiple Query [java.lang.NullPointerException]

i have function for running multiple query MariaDB. but i have problem with cfquery.
<cffunction name="testQuery">

<cftry>

    <cfquery name="qResult" datasource="dbsf_mariadev" result="qResult">

     BEGIN;

     DROP PROCEDURE if exists SF6COLA_INSERTTBL;

     CREATE PROCEDURE SF6COLA_INSERTTBL()

     LANGUAGE SQL

     BEGIN

          IF (select id from __contoh01 where id=1 and nilai=1) THEN

          BEGIN

          update __CONTOH01 set id=1,nilai=1 where id=1 and nilai=1;

          END;

          ELSE

          BEGIN

          insert ignore into __contoh01 (id,nilai) values (1,1) ON DUPLICATE KEY UPDATE id=1 , nilai=1;

          END;

          END IF;

    END;

    CALL SF6COLA_INSERTTBL();

    COMMIT;

    </cfquery>

    <cfdump var="#qResult#"/>

<cfcatch><cfdump var="#cfcatch#"/></cfcatch>

</cftry>

</cffunction>

result:

please help me to solved this case.

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

BKBK
Community Expert
Community Expert
Jan 24, 2016 3:03 PM UTC

I suspect you have a database error. To verify, run the SQL in a MySQL database management tool such as SQLyog. 

Translate
adrianh4955335
Participant
Jan 25, 2016 4:44 AM UTC

i was try in tools HeidiSQL, the result is success running this query

Translate
BKBK
Community Expert
Community Expert
Jan 25, 2016 5:29 AM UTC

What is the result of cfdump when you change <cfcatch> into <cfcatch type="database">?

Second idea: the error may have occurred elsewhere. For example, in Application.cfm or Application.cfc. Could you show us the code in your application file.

Translate