Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Greetings!

Status
Not open for further replies.

zerokode

Programmer
Jul 16, 2002
3
SI
I am not sure, if this question is the coldfusion related; but I am having a smaller problem with the ODBC connection / SQL query...

I am trying to select a single row from the SQL query, but I am not getting it right; And I need some helping hand... The Query I am trying to execute looks like something like this:

<cfquery name=&quot;userpermissionquery&quot; datasource=&quot;#db_dbsource#&quot; dbtype=&quot;#db_dbtype#&quot; username=&quot;#db_username#&quot; password=&quot;#db_password#&quot;>
SELECT DISTINCT UserPermissions.section_id, Sections.descriptions
FROM UserPermissions, Sections
WHERE uid=#userquery.id#
AND Sections.id = UserPermissions.section_id
</cfquery>

It's odd;;; I am trying to whip this up for many hours now... Can someone give me helping hand? Thanks!

Regards. ~W.
 
Are you sure there is only one record in userquery?
Also, if I had a permissions table relationship like the one you're describing, I would have multiple sections per userpermissions, anyway.

Let's say you had a client section and an invoice section (logical view) like the following:

User1, AccessLevel X, ClientSection
User1, AccessLevel X, InvoiceSection

So.... each user WOULD have multiple records... the distinct would not even apply because you would only only need one access level per section per user....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top