• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Multiple Query [java.lang.NullPointerException]

New Here ,
Jan 18, 2016 Jan 18, 2016

Copy link to clipboard

Copied

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:
testingQuery.png

please help me to solved this case.

Views

296

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2016 Jan 24, 2016

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 24, 2016 Jan 24, 2016

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2016 Jan 24, 2016

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation