Skip to main content
adrianh4955335
Participant
January 19, 2016
Question

Multiple Query [java.lang.NullPointerException]

  • January 19, 2016
  • 1 reply
  • 448 views

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 has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
January 24, 2016

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

adrianh4955335
Participant
January 25, 2016

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

BKBK
Community Expert
Community Expert
January 25, 2016

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.