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

CFQUERY in CFCOMPONENT

New Here ,
Jun 11, 2008 Jun 11, 2008
Unfortunately I the CFOUTPUT tag in the code does not give me any data. Yes I do have a component and a function in it that uses a query to get multiple fields of data. Any suggestions?

Thanks,
AJ
423
Translate
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
LEGEND ,
Jun 11, 2008 Jun 11, 2008
> Any suggestions?

Yep. Show us the code for the "getJourneyDetailsFunction" function. It's
a bit hard to say what you're doing wrong without seeing the code.

--
Adam
Translate
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 ,
Jun 11, 2008 Jun 11, 2008
quote:

Originally posted by: Newsgroup User
> Any suggestions?

Yep. Show us the code for the "getJourneyDetailsFunction" function. It's
a bit hard to say what you're doing wrong without seeing the code.

--
Adam



Sure Sir. Attached is the function code in Application.cfc...


Translate
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
LEGEND ,
Jun 11, 2008 Jun 11, 2008
Use cfsetting to enable debugging and look at how many records your query returns.
Translate
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 ,
Jun 11, 2008 Jun 11, 2008
I am new to ColdFusion but I would be glad to answer questions from other people. Subscribed to the the feed.
Translate
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 ,
Jun 11, 2008 Jun 11, 2008
Nothing. Surprisingly, this query returns values when used in the same file but when I put it in a component, it does not return anything and there is nothing displayed in the CFOUTPUT.

Strange!

Thanks for your help.
AJ
Translate
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
LEGEND ,
Jun 11, 2008 Jun 11, 2008
LATEST
What EXACTLY does it return? Nothing at all? A query with the correct
columns but no row? Something else?

I have to concede I've never put any bar the "standard" methods into
Application.cfc, but understand it's possible. I wouldn't havr thought
they'd be invoked by creating an instance of the Application.cfc though,
rather just:

<cfset result = application.myFunction(args=values)>

I can't test this currently though.

It's rather a strange CFC to want to put that sort of method in though. I
would only put methods specific to the actual application, session or
request scopes in that CFC. I'd have a Journey.cfc to deal with journey
type things.

It's nothing to do with your issue, but you should be VARing your
variables. And using <cfqueryparam> for you dynamic query parameters, so
they actually *are* treated as dynamic, rather than just part of the SQL
statement.

Indeed looking more at your SQL, you're using hard-coded strings for things
like originStationCode, rather than the actual variable you're passing in.
I doubt that query - withouth modification - actually *does* work
elsewhere.

--
Adam

--
Adam
Translate
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