gavinbaumanis
07/24/2023, 10:30 AM<cfset "ds.results" = new query(
name = "q",
datasource = customer.getDataSource(),
sql = theSQLtoRun).execute().getResult() />
It throws an error:
The named parameter [00] has not been provided
The only place in the SQL that has "00" in it is in the WHERE clause
select xxxxx
WHERE zzzzzzz
AND x.survey_date BETWEEN '2023-06-01 01:00' AND '2023-06-10 23:59'
If I change the start date in the WHERE clause to '2023-06-01 01:06'
Then the error message changes to:
The named parameter [06] has not been provided
Whatever is in the "minutes" section of the start date, ends up in the error message.
Also: I have tried for the past 3 full days to work out how to reproduce it - so that I could put something repeatable into a GIST / tryCF...
But I can't get it to fail, outside of where it is in the application code.
I dump the contents of theSQLtoRun, directly before running the SQL that fails - and it looks completely normal.
I copy/paste the SQL in the dump() directly into the DB - and of course, it runs without failing.
I am open to any ideas at all.zackster
07/24/2023, 10:31 AMzackster
07/24/2023, 10:31 AMAdam Cameron
preserveSingleQuotes on the passed-in string.
But, @gavinbaumanis, why the hell are you using new Query etc to run SQL??! It's 2023 mate.gavinbaumanis
07/24/2023, 10:33 AMAdam Cameron
zackster
07/24/2023, 10:34 AMgavinbaumanis
07/24/2023, 10:34 AMgavinbaumanis
07/24/2023, 10:35 AMzackster
07/24/2023, 10:35 AMzackster
07/24/2023, 10:35 AMwhere lastUpdate :lastUpdated (or the timestamp) in your case. use params like it's 2023gavinbaumanis
07/24/2023, 10:36 AMAdam Cameron
Adam Cameron
: should not be considered the beginning of a param placeholder if the : is within a string, which is it here.Adam Cameron
Query.cfc was only ever a CF hack to be able to do DB calls from CFScript. Am pretty sure Lucee only includes it for sideways compat, but also seem to recall it was never recommended. queryExecute was added to native CFML in CF11 in 2014. That's what you ought to be using.gavinbaumanis
07/24/2023, 10:42 AMzackster
07/24/2023, 10:44 AMzackster
07/24/2023, 10:45 AMzackster
07/24/2023, 10:46 AMgavinbaumanis
07/24/2023, 10:51 AMlucee.runtime.exp.CustomTypeException: The named parameter [02] has not been provided at lucee.runtime.tag.Throw._doStartTag(Throw.java:212) at lucee.runtime.tag.Throw.doStartTag(Throw.java:201) at throw_cfm$cf.udfCall(/throw.cfm:11) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213) at lucee.runtime.functions.system.CFFunction.call(CFFunction.java:109) at org.lucee.cfml.query_cfc$cf.udfCall(/org/lucee/cfml/Query.cfc:188) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:786) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1775) at org.lucee.cfml.query_cfc$cf.udfCall(/org/lucee/cfml/Query.cfc:103) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:786) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1775) at org.lucee.cfml.query_cfc$cf.udfCall(/org/lucee/cfml/Query.cfc:34) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:664) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1933) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1775) at scripts.csvextract.au.csvextractau_v4_cfm$cf.call(/dbsetup/scripts/csvExtract/au/csvExtractAU_v4.cfm:2672) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1025) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:948) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:219) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2493) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2478) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2449) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1216) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1162) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:590) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:47) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at runwar.undertow.SSLClientCertHeaderHandler.handleRequest(SSLClientCertHeaderHandler.java:144) at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275) at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79) at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134) at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131) at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449) at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) at java.base/java.lang.Thread.run(Unknown Source)gavinbaumanis
07/24/2023, 11:24 AMdswitzer
07/24/2023, 11:31 AMzackster
07/24/2023, 11:49 AMcfvonner
07/24/2023, 3:57 PMzackster
07/24/2023, 3:58 PMcfvonner
07/24/2023, 4:06 PMzackster
07/24/2023, 4:22 PMAdam Cameron
Adam Cameron
gavinbaumanis
07/25/2023, 12:19 AMnew query
And the ones that aren't - are still in tags.,zackster
07/25/2023, 9:49 AM