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

calling mysql table from CFC Error

Explorer ,
Dec 22, 2022 Dec 22, 2022

Copy link to clipboard

Copied

never had this issue before but when querying a db from my component I received the following error:

 

[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'collection_lines'.

 

The query works just fine from console and the table exists all db privilages match.

 

To troubleshoot i pulled the same query from my cfm page rather than the component and it functioned normally.

Views

314

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

correct answers 1 Correct answer

Community Expert , Dec 22, 2022 Dec 22, 2022

ColdFusion is telling you that the table 'collection_lines' does not exist. There is a clue that ColdFusion may be right. 

 

You mention in the beginning that the datasource is MySQL. However, the stacktrace concerns an MS SQL Server datasource.  

Votes

Translate

Translate
Community Beginner ,
Dec 22, 2022 Dec 22, 2022

Copy link to clipboard

Copied

Check CF is reading from the same database you are doing the manual query in. Perhaps CF is reading from prod when you are checking dev etc. This might be setup in the code or the CF admin. 

 

This error simply means the table / column doesnt exist. 

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
Explorer ,
Dec 22, 2022 Dec 22, 2022

Copy link to clipboard

Copied

Both my CFC and my CFM page are using the same datasource though.  When using the cfquery on the CFC i get the error however the cfquery works with the same code on the CFM page. 

 

including stack:

 

java.sql.SQLSyntaxErrorException: [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'collection_lines'. at macromedia.jdbc.sqlserverbase.ddcw.b(Unknown Source) at macromedia.jdbc.sqlserverbase.ddcw.a(Unknown Source) at macromedia.jdbc.sqlserverbase.ddcv.b(Unknown Source) at macromedia.jdbc.sqlserverbase.ddcv.a(Unknown Source) at macromedia.jdbc.sqlserver.tds.ddr.v(Unknown Source) at macromedia.jdbc.sqlserver.tds.ddr.a(Unknown Source) at macromedia.jdbc.sqlserver.tds.ddr.c(Unknown Source) at macromedia.jdbc.sqlserver.dda4.m(Unknown Source) at macromedia.jdbc.sqlserverbase.dde7.e(Unknown Source) at macromedia.jdbc.sqlserverbase.dde7.a(Unknown Source) at macromedia.jdbc.sqlserverbase.dde7.x(Unknown Source) at macromedia.jdbc.sqlserverbase.dde7.t(Unknown Source) at macromedia.jdbc.sqlserverbase.dde7.execute(Unknown Source) at coldfusion.server.j2ee.sql.JRunStatement.execute(JRunStatement.java:359) at coldfusion.sql.Executive.executeQuery(Executive.java:1567) at coldfusion.sql.Executive.executeQuery(Executive.java:1317) at coldfusion.sql.Executive.executeQuery(Executive.java:1247) at coldfusion.sql.SqlImpl.execute(SqlImpl.java:427) at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:1211) at coldfusion.tagext.sql.QueryTag.setupCachedQuery(QueryTag.java:1131) at coldfusion.tagext.sql.QueryTag.startQueryExecution(QueryTag.java:833) at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:794) at cfrWidget2ecfc36613338$funcWIDGET_MONTHLY_RENEWALS.runFunction(/Applications/ColdFusion2018/cfusion/wwwroot/COM/ROBRY/rWidget.cfc:11) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:554) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:485) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:448) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:399) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:372) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:609) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:835) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:641) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3549) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3524) at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:472) at cfmonth_renewals2ecfm95714310.runPage(/Applications/ColdFusion2018/cfusion/wwwroot/robry/dashboard/widgets/month_renewals.cfm:4) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:262) at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:735) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:565) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:4329) at cfindex2ecfm603211228.runPage(/Applications/ColdFusion2018/cfusion/wwwroot/robry/dashboard/index.cfm:123) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:262) at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:735) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:565) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:4329) at cfApplication2ecfc1712764466$funcONREQUEST.runFunction(/Applications/ColdFusion2018/cfusion/wwwroot/robry/Application.cfc:31) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:554) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:448) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:399) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:372) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:288) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:830) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:613) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:438) at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:115) at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:308) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:551) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:162) at coldfusion.filter.IpFilter.invoke(IpFilter.java:45) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:96) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:78) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:226) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:228) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:373) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1723) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:834)

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 ,
Dec 22, 2022 Dec 22, 2022

Copy link to clipboard

Copied

ColdFusion is telling you that the table 'collection_lines' does not exist. There is a clue that ColdFusion may be right. 

 

You mention in the beginning that the datasource is MySQL. However, the stacktrace concerns an MS SQL Server datasource.  

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
Explorer ,
Dec 22, 2022 Dec 22, 2022

Copy link to clipboard

Copied

You were right, I was wrong.  Sorry\.  I had this.datasource and session.datasource and theyre different.  Sorry about that

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 ,
Dec 22, 2022 Dec 22, 2022

Copy link to clipboard

Copied

LATEST

No problem. Happens to us all. 🙂

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