Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

InnerJoin not working

Posted on 2006-05-29
6
Medium Priority
?
197 Views
Last Modified: 2013-12-24
Hi- Here is my query:

<CFQUERY  NAME="get_products">
    SELECT     *
    FROM      products INNER JOIN sizes
      ON  products.id=sizes.product_id
      WHERE active='1'
</CFQUERY>

But I get an coldfusion error, "Attribute validation error for tag CFQUERY.  
The tag has an invalid attribute combination: name."  

If I do this, it pulls properly, but I can't have the WHERE Active='1' parameter:

<CFQUERY DATASOURCE="#request.maindsn#" NAME="get_products">
    SELECT     *
    FROM      products, sizes
      WHERE products.id=sizes.product_id
</CFQUERY>


0
Comment
Question by:mel150
  • 3
  • 3
6 Comments
 
LVL 36

Expert Comment

by:SidFishes
ID: 16785894
unless Active datatype is text (char, varchar, text etc)

 needs to be

  WHERE active=1

0
 

Author Comment

by:mel150
ID: 16785904
Aha! Thanks! I will test a little later and get back to you.
0
 

Author Comment

by:mel150
ID: 16786274
Hi- Now I have:

<CFQUERY  NAME="get_products">
    SELECT     *
    FROM      products INNER JOIN sizes
      ON  products.id=sizes.product_id
      WHERE active=1
</CFQUERY>

And I am still getting the same error.."Attribute validation error for tag CFQUERY.  
The tag has an invalid attribute combination: name."  Here are more details from the error:

The tag has an invalid attribute combination: name. Possible combinations are:<li>Required attributes: &apos;datasource&apos;. Optional attributes: &apos;blockfactor,cachedafter,connectstring,dbname,dbpool,dbserver,dbtype,debug,maxrows,name,password,provider,providerdsn,sql,timeout,username&apos;. <li>Required attributes: &apos;datasource&apos;. Optional attributes: &apos;blockfactor,cachedwithin,connectstring,dbname,dbpool,dbserver,dbtype,debug,maxrows,name,password,provider,providerdsn,sql,timeout,username&apos;. <li>Required attributes: &apos;dbtype&apos;. Optional attributes: &apos;blockfactor,cachedwithin,connectstring,datasource,dbname,dbpool,dbserver,debug,maxrows,name,password,provider,providerdsn,sql,timeout,username&apos;. <li>Required attributes: &apos;dbtype,name&apos;. Optional attributes: &apos;cachedwithin,debug,maxrows,sql,timeout&apos;. <li>Required attributes: &apos;dbtype,name&apos;. Optional attributes: &apos;cachedafter,debug,maxrows,sql,timeout&apos;.

Any other thoughts? :)

Thanks!
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 36

Expert Comment

by:SidFishes
ID: 16786557
hmmm...3 issues perhaps

Use

Active  = 1


you have to have datasource (this is the source of the attirbute error near name

<CFQUERY DATASOURCE="#request.maindsn#" NAME="get_products">

you'll need to scope your Active value


<CFQUERY  NAME="get_products">
    SELECT     *
    FROM      products INNER JOIN sizes
     ON  products.id=sizes.product_id
     WHERE products.active=1 <!--- I'm guessing Active is in Products Table --->
</CFQUERY>
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 2000 total points
ID: 16786582

oops that last bit should be

<CFQUERY DATASOURCE="#request.maindsn#" NAME="get_products">
    SELECT     *
    FROM      products INNER JOIN sizes
     ON  products.id=sizes.product_id
     WHERE products.active=1 <!--- I'm guessing Active is in Products Table --->
</CFQUERY>
0
 

Author Comment

by:mel150
ID: 16786760
Rockin!! Thanks so much.

Mel
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Integration Management Part 2
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question