Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsBig SQL StatementsBig SQL Statements
Previous
 
Next
New Post
7/9/2008 11:44 AM
 

Hi There,

Very new to SQL so please bear with me. I am trying to run a report that dumps all the information on a users profile for users of a certain role. I seem to be running into a problem where the SQL statement is so long, it's being truncated.

Maybe there is an easier way of doing this that results in a smaller SQL statement? The code below is only how far I got before I ran into this problem.. there are more fields I would like to have added...

SELECT     U.Username, U.FirstName, U.LastName, U.Email,
                          (SELECT     PropertyValue
                            FROM          pr_UserProfile
                            WHERE      (UserID = U.UserID) AND (PropertyDefinitionID = 31)) AS PhoneNum,
                          (SELECT     PropertyValue
                            FROM          pr_UserProfile AS pr_UserProfile_2
                            WHERE      (UserID = U.UserID) AND (PropertyDefinitionID = 25)) AS Unit,
                          (SELECT     PropertyValue
                            FROM          pr_UserProfile AS pr_UserProfile_2
                            WHERE      (UserID = U.UserID) AND (PropertyDefinitionID = 26)) AS Street,
                          (SELECT     PropertyValue
                            FROM          pr_UserProfile AS pr_UserProfile_2
                            WHERE      (UserID = U.UserID) AND (PropertyDefinitionID = 27)) AS strCity,
                          (SELECT     PropertyValue
                            FROM          pr_UserProfile AS pr_UserProfile_2
                            WHERE      (UserID = U.UserID) AND (PropertyDefinitionID = 28)) AS strRegion,
                          (SELECT     PropertyValue
                            FROM          pr_UserProfile AS pr_UserProfile_2
                            WHERE      (UserID = U.UserID) AND (PropertyDefinitionID = 30)) AS strPostalCode,
                          (SELECT     PropertyValue
                            FROM          pr_UserProfile AS pr_UserProfile_2
                            WHERE      (UserID = U.UserID) AND (PropertyDefinitionID = 31)) AS strTele,
                          (SELECT     PropertyValue
                            FROM          pr_UserProfile AS pr_UserProfile_2
                            WHERE      (UserID = U.UserID) AND (PropertyDefinitionID = 45)) AS strMobile
FROM         pr_UserPortals AS UP RIGHT OUTER JOIN
                      pr_UserRoles AS UR INNER JOIN
                      pr_Roles AS R ON UR.RoleID = R.RoleID RIGHT OUTER JOIN
                      pr_Users AS U ON UR.UserID = U.UserID ON UP.UserId = U.UserID
WHERE     (UP.PortalId = 0) AND (R.RoleName = 'Birdline Member')
ORDER BY U.LastName

When I paste this in the code box then apply it, it is truncted and the last few lines lost.

So, any ideas how I can get round this ?

cheers

 
New Post
7/9/2008 1:35 PM
 

Rather than using subqueries, you could use inner joins....but the key issue is that queries are limited by the size of the settingsvalue column of the modulesettings table.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
7/9/2008 5:47 PM
 

you might be better off using the reports module (http://www.dotnetnuke.com/tabid/125/default.aspx) for this kind of thing - http://www.dotnetnuke.com/Community/Blogs/tabid/825/BlogID/196/Default.aspx has a bunch of blog entries that might help give you an idea of the capabilities.

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
7/10/2008 3:33 AM
 

cathal connolly wrote

you might be better off using the reports module (http://www.dotnetnuke.com/tabid/125/default.aspx) for this kind of thing - http://www.dotnetnuke.com/Community/Blogs/tabid/825/BlogID/196/Default.aspx has a bunch of blog entries that might help give you an idea of the capabilities.

Cathal



sorry confused.. I AM using the reports module.. this is the reports module forum!??! Or did you mean something else ?

 
New Post
7/10/2008 3:34 AM
 

Mitch Sellers wrote

Rather than using subqueries, you could use inner joins....but the key issue is that queries are limited by the size of the settingsvalue column of the modulesettings table.



So does that mean there is no way round this ??

Sorry, new at DNN and SQL etc.. feeling in the dark here :D

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsBig SQL StatementsBig SQL Statements


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out