Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Custom SQL Fails using Procedure
Last Post 06-18-2010 12:13 AM by Adam. 4 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
AdamUser is Offline
river guide
river guide
Posts:116
Avatar

--
06-15-2010 03:28 AM

    I have a procedure that returns records based on dynamic SQL, I then use the following SQL to return the data into the dynamic view module, but no data is displayed. I enter the same query into DNN/Host/SQL and the data is returned correctly, please help;

    SQL: (It also works using a combo in dynamic forms) 

    DECLARE @RetTable TABLE (
        Username nvarchar(255),
        AccountID int,
        Pass nvarchar(255),
        Title nvarchar(255),
        FullName nvarchar(255),
        Email nvarchar(255),
        TelNo nvarchar(50),
        JobTitle nvarchar(255),
        Signatory int,
        UserGroup int,
        Inactive int,
        UserFilter int,
        HierarchID int,
        LanguageID int)
     
      DECLARE @SQL nvarchar(255)
     
      SET @SQL = 'SELECT Username,AccountID,UserPassword,Title,FullName,EmailFromAddress'
      SET @SQL = @SQL + ',UserTelephoneNo,JobTitle,SignatoryID,UserGroupID,Inactive'
      SET @SQL = @SQL + ',UserFilterID,HierarchyID,LanguageID'
      SET @SQL = @SQL + ' FROM [server1].[database2].[dbo].[Users]'
     
      BEGIN
        -- Execute the dynamic SQL
        INSERT INTO @RetTable(
        Username,
        AccountID,
        Pass,
        Title,
        FullName,
        Email,
        TelNo,
        JobTitle,
        Signatory,
        UserGroup,
        Inactive,
        UserFilter,
        HierarchID,
        LanguageID)
        EXEC sp_executesql @SQL
        --PRINT @RetTable
      END

    SELECT Username AS QuestionOption, Username AS QuestionOptionValue FROM @RetTable

     

    AdamUser is Offline
    river guide
    river guide
    Posts:116
    Avatar

    --
    06-15-2010 03:29 AM

    Sorry, version info = 1.0.5.25948 / 5.4.2

    Error trace:

    Loading Data With Errors:Incorrect syntax near the keyword 'DECLARE'. Incorrect syntax near the keyword 'FROM'. at DataSprings.DNN.Modules.DynamicViews.DynamicViews.GenerateReport(String Status, String strNewRecordsPerPage, String strDetailView) at DataSprings.DNN.Modules.DynamicViews.DynamicViews.GetData(String Status, String strNewPageSize) at DataSprings.DNN.Modules.DynamicViews.DynamicViews.Page_Load(Object sender, EventArgs e)
    Inside Get Data:Load
    New Page Size:

    Search Error:
    Search Error Message:Incorrect syntax near the keyword 'DECLARE'. Incorrect syntax near the keyword 'FROM'.
    Search Error Stack Trace: at DataSprings.DNN.Modules.DynamicViews.DynamicViews.GenerateReport(String Status, String strNewRecordsPerPage, String strDetailView) at DataSprings.DNN.Modules.DynamicViews.DynamicViews.GetData(String Status, String strNewPageSize) at DataSprings.DNN.Modules.DynamicViews.DynamicViews.Page_Load(Object sender, EventArgs e)

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    06-17-2010 03:18 PM
    HI, I believe dynamic views can only use a basic "Select" sql statement to return values as opposed to using the "declare" and "exec sp_executesql @SQL" keywords. Perhaps you can modify this to a "select" statement instead.

    What is the content of your "sp_executesql" procedure? -- David
    AdamUser is Offline
    river guide
    river guide
    Posts:116
    Avatar

    --
    06-17-2010 09:54 PM
    Hi David,
    The SQL is dynamic thus the database name is passed using a session variable to achive the correct results. My method works in dynamic forms without any problem.

    sp_executesql - This is a standard (built-in) MS SQL Server procedure.

    Thanks
    AdamUser is Offline
    river guide
    river guide
    Posts:116
    Avatar

    --
    06-18-2010 12:13 AM

    My work around is easy as Dynamic Views affectively supports dynamic SQL so I can replace the database name in the SQL by using a session variable..

    SELECT Username,AccountID,UserPassword,Title,FullName,EmailFromAddress
    UserTelephoneNo,JobTitle,SignatoryID,UserGroupID,Inactive
    ,UserFilterID,HierarchyID,LanguageID
    FROM [server1].[$(DSSession1)].[dbo].[Users]

    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi