Hi all,
I've never used cfqueryparam with INSERT statement in cfquery before, but now whenever I try it, I get an NullPointerException.
My code:
<cfquery name="insertDocEntry"
result="docEntry"
datasource="#Application.PrimaryDataSource#">
INSERT INTO tbl_conference_document
(SessionID, DocTypeID, Symbol, Language, Title)
VALUES (
<cfqueryparam value="#Form.SessionID#" cfsqltype="cf_sql_numeric">,
<cfqueryparam value="#Form.DocTypeID#" cfsqltype="cf_sql_numeric">,
<cfqueryparam value="#Form.Symbol#" cfsqltype="cf_sql_varchar">,
<cfqueryparam value="#Form.Language#" cfsqltype="cf_sql_varchar">,
<cfqueryparam value="#Form.Title#" cfsqltype="cf_sql_varchar">
)
</cfquery>
I cfdump the form scope and all the values are set, but I still get this error:
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
| The following information is meant for the website developer for debugging purposes. |
|
| Error Occurred While Processing Request |
| The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code. Null Pointers are another name for undefined values. | | | The error occurred in D:\ColdFusion9\wwwroot\Infobase\Document\execConferenceDocUpload.cfm: line 28 | 26 : <cfqueryparam value="#Form.Symbol#" cfsqltype="cf_sql_varchar">, 27 : <cfqueryparam value="#Form.Language#" cfsqltype="cf_sql_varchar">, 28 : <cfqueryparam value="#Form.Title#" cfsqltype="cf_sql_varchar"> 29 : ) 30 : </cfquery>
|
| | Resources: | |
| Stack Trace | at cfexecConferenceDocUpload2ecfm1876641633.runPage(D:\ColdFusion9\wwwroot\Infobase\Document\execConferenceDocUpload.cfm:28) at cfApplication2ecfc1086350920$funcONREQUEST.runFunction(D:\ColdFusion9\wwwroot\Infobase\Application.cfc:230) java.lang.NullPointerException at coldfusion.sql.QueryTable.populate(QueryTable.java:325) at coldfusion.sql.QueryTable.populate(QueryTable.java:261) at coldfusion.sql.Executive.getRowSet(Executive.java:466) at coldfusion.sql.Executive.executeQuery(Executive.java:1248) at coldfusion.sql.Executive.executeQuery(Executive.java:1008) at coldfusion.sql.Executive.executeQuery(Executive.java:939) at coldfusion.sql.SqlImpl.execute(SqlImpl.java:341) at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:843) at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:533) at cfexecConferenceDocUpload2ecfm1876641633.runPage(D:\ColdFusion9\wwwroot\Infobase\Document\execConferenceDocUpload.cfm:28) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfApplication2ecfc1086350920$funcONREQUEST.runFunction(D:\ColdFusion9\wwwroot\Infobase\Application.cfc:230) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:490) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:336) at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88) at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:280) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:338) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:87) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126) at coldfusion.CfmServlet.service(CfmServlet.java:200) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
|
|
This error does NOT occur when I'm not using cfqueryparam, but my problem is, I need to insert some uploaded file content into the database as BLOB (code not shown above because this is a problem even without BLOB), so far the only way I know how to do this is using CFQUERYPARAM.
Am I the only one seeing this here? So far I only tried using my local CF9 server (Developer Edition), the CF9 server on my collegue's machine has the same problem.
We have a very tight deadline here and I really didn't expect this kind of trouble, so any help and hint is highly appreciated!
Thanks in advance!
ZHU, Jia