Recently Viewed...
To help you navigate to pages you most recently visited, select from the links below.
Product Forums
Sharepoint Forums
Newsletter
Dynamic Forms Demonstrations
Page Tags
DNN Modules
SnowCovered Top Sellers

'Relationship Building' and 'Communication' are two essential nuts and bolts for a business to prosper. This module allows you to bridge both of these and easily generate continuous awareness of your web site, products and services. Your prospects and customers will greatly appreciate this featur

Live Content uses Web 2.0 approach to provide a Rich User Interface and streamlines content presentation by overlaying content on current page. Overlay images, videos, audio, text/html content, flash, dotnetnuke modules, and external content. Experience the demo...

Version 5 of the perennial best-selling tool for creating data-based solutions in DNN without custom programming. This version focuses on greater flexibility, expandability, and ease-of-use.

Powerful, Ajax Enabled, Easy to Use. Document Management has never been better. Open-DocumentLibrary allows DotNetNuke users to share and manage documents in a flexible, intelligent way, offering granular control over Folder and Document access.

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to add videos in various format and automatically convert them to flv format, you also can add videos from embed code and play them in our integrated flash video player.

Gloss is the first ALL COLORS! skin, featuring a powerful XML-based flash and being 100% W3C CSS XHMTL1.0 compliant. Tune it yourself on the fly, changing colors, backgrounds, containers, text color and size, width and more! Brilliant!Available for DNN4 and DNN5

The award winning discussion forum and community solution for DotNetNuke is now even better. When you need to build the best community site, you need the best module, Active Forums!

ALL NEW ! - Minimalist includes skin packs in 12 great colors. Each color has Flat, Gradient and Glass versions. Feature rich XML Flash header, perfect for just about any purpose. 9 Different menu options in each skin pack; 3 horizontal menus, 3 vertical menus and 3 all-new Twin level menus . . .

Edit documents directly on your server. The premier document management solution for DotNetNuke (DNN). Index contents of documents. Share documents across your portal and avoid duplicates. Revised and flexible UI. Extensible architecture.

Ultra Media Gallery is the most popular photo gallery and media gallery solution for DotNetNuke, UMG offers 10 different flash player to browse your gallery with completely different user interface experience.

    |   Register   |   Wednesday, January 07, 2009   
Data Springs Product Forums...
Subject: Any way to use tokens to write generic SQL?
Prev Next
You are not authorized to post a reply.

Author Messages
Mark
Posts:3


01/18/2008 11: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
Posts:2385
river guide
river guide

01/18/2008 6: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.
Forums > Product Discussion - DotNetNuke Modules > Dynamic Forms > Any way to use tokens to write generic SQL?



ActiveForums 3.7

Copyright 2005 - 2009 by Data Springs, Inc.
Terms Of Use | Privacy Statement