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!

Any way to use tokens to write generic SQL?
Last Post 01-18-2008 04:30 PM by Chad Nash. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Mark BurggrafUser is Offline
new to the springs
new to the springs
Posts:3
Avatar

--
01-18-2008 09:30 AM

    If I want to create forms that are portable to other portals in the future, shouldn't I try make the embedded SQL portable as well?  For example, I have a SQL statement to drive my Region (State) dropdown list:

    select Text as QuestionOption,Value as QuestionOptionValue from ABC_Lists where listname = 'Region' order by Text

    where ABC is the name of my portal.  But what if I want to export this form and give it to someone using a different portal (and thus, has a different table prefix?  Is there a token available that would allow me to make this generic?

     

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    01-18-2008 04:30 PM
    Hi. Well this is not an option but I really don't think it would be as useful or used as much as you would think. When reviewing this, there are a few options which I think would be a 'better approach'.

    Option 1: Use a stored procedure... Within the stored procedure and/or view you could pass the portalID. So something like:
    exec sp_pullregions $(PortalID)


    Then the stored procedure would probably have either if statements or select case statements which would pull in the questionoption and questionoptionvalue from the appropriate table


    Option 2: Use a view instead of a table, this way the query would not ever change per forms module and you would just have to change the view per portal or server

    Select Text as QuestionOption, Text as QuestionOptionValue from vw_lists_region

    etc... You could setup individual views for region, country, and so forth or you could also just use a single view and add the listname to the SQL when pulling from the view just like you do the query.


    Option 3: Are these portals/databases all on a single database server? If so you could always use a single table with your questions and options in it and then pass the portalID.

    Example: Select Text as QuestionOption, Value as QuestionOptionValue from YourCustomTable where PortalID = $(PortalID)

    -Chad
    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