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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModule Install doesnModule Install doesn't like SQL LIKE Statements...
Previous
 
Next
New Post
4/8/2010 11:11 AM
 

We have a multi-module application that uses lots of LIKE statements in the SQL scripts. The scripts install find in the Host SQL option, but will not install in the Package Assembly installation.

Testing PA on version 4.8.1. Here is one of the select scripts that fails, with the point of failure marked...

 

PROCEDURE [dbo].[WebCo_STSCustomers_R] (

@CustID

int

 

, @PortalID int

 

, @Name nvarchar(50)

 

, @City nvarchar(50)

 

, @State nchar(2)

 

)

AS

SET

SET

NOCOUNT ON XACT_ABORT OFF -- Allow procedure to continue after error

DECLARE

@ErrorNo int -- Local variable to capture the error code.

DECLARE

@RowCount int -- Number of rows returned

DECLARE

 

-- *******************

-- Set local variables

-- *******************

@ErrMsg nvarchar(1000) -- Error message to return

SET

@ErrorNo = 0

SET

 

@RowCount = 0

-- ************

-- Get the data

-- ************

SELECT

CustID

 

 

 

 

 

 

 

 

 

 

 

 

= [CustID], PortalID = [PortalID], Name = [Name], Address1 = [Address1], Address2 = [Address2], City = [City], State = [State], PostalCode = [PostalCode], PrimaryPhone = [PrimaryPhone], AltPhone = [AltPhone], CellPhone = [CellPhone], Contact = [Contact], EMailAddress = [EMailAddress]

FROM

STSCustomers

WHERE

 

AND

(([CustID] = @CustID) OR (@CustID IS NULL))

 

AND

(([PortalID] = @PortalID) OR (@PortalID IS NULL))

 

AND

(([Name] LIKE @Name + '%') OR (@Name IS NULL))             <==This line is where it appears to fail...

 

AND

(([City] LIKE @City + '%') OR (@City IS NULL))

 

 

 

(([State] = @State) OR (@State IS NULL))

SELECT

@ErrorNo

= @@Error

 

, @RowCount = @@RowCount

IF

(@ErrorNo != 0)

 

BEGIN

 

SELECT @ErrMsg = 'Error getting STSCustomers records in [dbo].[WebCo_STSCustomers_R]'

 

 

GOTO

 

GOTO ENDERROREND ENDOK

-- **************

-- Error Handling

-- **************

ENDERROR:

 

BEGIN

 

 

 

ENDOK:

RAISERROR 25000 @ErrMsgRETURN 1END

 

RETURN 0

GO

 The scripts work find in SQL and in the Host SQL option. Syntax appears to be a DNN issue...

 

Anyone got any ideas?

 

 

CREATE

 
New Post
4/8/2010 12:57 PM
 

all the scripts in your module should use the {databaseOwner}{objectQualifier} tokens, so everywhere you reference a database object, preface it with {databaseOwner}{objectQualifier}

eg:
where you have
PROCEDURE [dbo].[WebCo_STSCustomers_R]

you should have
PROCEDURE {databaseOwner}[{objectQualifier}WebCo_STSCustomers_R]

 
New Post
4/8/2010 1:52 PM
 

Be sure that your .SqlDataProvider script files are saved with UTF-8 not ANSI encoding. Those saved as ANSI will have '+' characters and some others stripped out when installed by the PA installer but will run fine when pasted into and run with the Host-->SQL control.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
4/8/2010 2:27 PM
 

These scripts are executing into a separate database, not the website database. It has nothing to do with the error...

 
New Post
4/8/2010 2:29 PM
 

The PA unit does not like the followin:

<?xml version="1.0" encoding="utf-8" ?>

So how do you save the script in UTF-8 without this type of structure...

The SQL engine complains about the left Less-Than bracket...

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModule Install doesnModule Install doesn't like SQL LIKE 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