Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Reports Module ...  Big SQL Statements
Previous Previous
 
Next Next
New Post 7/9/2008 9:44 AM
User is offline SadisticRabbit
28 posts
10th Ranked


Big SQL Statements 

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


http://www.parrot-rescue.org.uk
 
New Post 7/9/2008 11:35 AM
User is offline Mitch Sellers
5719 posts
www.mitchelsellers.com
3rd Ranked




Re: Big SQL Statements 

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
MCITP, MCPD, MCTS
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 Consulting Quotes, and DNN Technical Support Services

I reccomend 3Essentials for shared hosting and BaseCamp for project management
 
New Post 7/9/2008 3:47 PM
User is offline cathal connolly
2756 posts
www.cathal.co.uk
5th Ranked










Re: Big SQL Statements 

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

 
New Post 7/10/2008 1:33 AM
User is offline SadisticRabbit
28 posts
10th Ranked


Re: Big SQL Statements 

 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 ?


http://www.parrot-rescue.org.uk
 
New Post 7/10/2008 1:34 AM
User is offline SadisticRabbit
28 posts
10th Ranked


Re: Big SQL Statements 

 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


http://www.parrot-rescue.org.uk
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Reports Module ...  Big SQL Statements
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Powered by Adcuent®.Com
Adcuent® Consulting & Technology offers custom development web applications and hosting projects under the brand of Powered by Adcuent®.Com
www.adcuent.com
Easily Build DNN Solutions with XMod
XMod makes it easy to build news articles, house listings, custom feedback forms, product reviews and much more - without programming
www.DNNDev.com
Software Development and Integration with DNN
HNP Solutions focuses on the pragmatic use of technology and process to meet an organization's business objectives. HNP Solutions employs seasoned Enterprise and Solution Architects, Delivery Managers and QA & Business Leads. Our capabilities range from project assessments & recommendations, design & code reviews, to full program implementations. We also work with organizations in need of senior staff augmentation purposes in the areas of Enterprise and Solution architecture.
www.hnpsolutions.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP