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  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Problem creating SPs when installing custom module
Previous Previous
 
Next Next
New Post 5/17/2007 3:06 PM
User is offline Steve Wyatt
4 posts
10th Ranked


Problem creating SPs when installing custom module 

Hi all, I'm having trouble creating a couple of stored procedures when installing a module package I created.  The module works fine on my developement box but I get the following errors when it installs elsewhere:

Failure SQL Execution resulted in following Exceptions: System.Data.SqlClient.SqlException: Line 6: Incorrect syntax near 'JobCodeDesc'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE IRIS_User.DNN_spCSJobCodesGetAll @ModID int AS SET NOCOUNT ON SELECT JobCodesID,JobCode,ModuleID,JobCodeDesc, JobCode '-' JobCodeDesc AS JCwDesc FROM IRIS_User.DNN_T_CSJobCodes WHERE ModuleID=@ModID System.Data.SqlClient.SqlException: Line 10: Incorrect syntax near '@Modstr'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE IRIS_User.DNN_spCSRequestGetAll @ModID int, @qSortBy varchar(20), @qOrderBy varchar(10) as declare @query varchar(2000) declare @ModStr varchar(50) select @ModStr=RTRIM(CONVERT(VarChar,@ModID)) set @query = 'SELECT JobID,JobCode,JobName,ProgramDept,ProjectContact,ApprovalList,TBICopy,TBICopyProvBy,TBICopyAttach,TBILogos,TBILogosProvBy,TBILogosAttach,TBIImages,TBIImagesProvBy,TBIImagesAttach,TBISpecs,TBISpecsProvBy,TBISpecsAttach,Description,QuoteRequired,InHouse,CopyDue,FirstComp,ToClient,Delivery,ToSeparator,Quantity,ShipTo,MiscNotes,DateOpened,PreviousArtist,Artist,RequestingUserID,JobStatus,JobNumber,ModuleID FROM IRIS_User.DNN_T_CSRequest WHERE IRIS_User.DNN_T_CSRequest.ModuleID=' @Modstr ' ORDER BY ' @qSortBy ' ' @qOrderBy execute (@query) System.Data.SqlClient.SqlException: Line 11: Incorrect syntax near '@Modstr'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE IRIS_User.DNN_spCSRequestGetAll_byStatus @ModID int, @JobStatus varchar(5), @qSortBy varchar(20), @qOrderBy varchar(10) AS declare @query varchar(2000) declare @ModStr varchar(50) select @ModStr=RTRIM(CONVERT(VarChar,@ModID)) set @query = 'SELECT JobID,JobCode,JobName,ProgramDept,ProjectContact,ApprovalList,TBICopy,TBICopyProvBy,TBICopyAttach,TBILogos,TBILogosProvBy,TBILogosAttach,TBIImages,TBIImagesProvBy,TBIImagesAttach,TBISpecs,TBISpecsProvBy,TBISpecsAttach,Description,QuoteRequired,InHouse,CopyDue,FirstComp,ToClient,Delivery,ToSeparator,Quantity,ShipTo,MiscNotes,DateOpened,PreviousArtist,Artist,RequestingUserID,JobStatus,JobNumber,ModuleID FROM IRIS_User.DNN_T_CSRequest WHERE IRIS_User.DNN_T_CSRequest.ModuleID=' @Modstr ' AND IRIS_User.DNN_T_CSRequest.JobStatus=' @JobStatus ' ORDER BY ' @qSortBy ' ' @qOrderBy execute (@query) System.Data.SqlClient.SqlException: Line 16: Incorrect syntax near '@Modstr'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE IRIS_User.DNN_spCSRequestGetAll_byStatusUser @ModID int, @JobStatus bit, @ReqUserID int, @qSortBy varchar(20), @qOrderBy varchar(10) AS declare @query varchar(2000) declare @ModStr varchar(50) declare @JobStr varchar (1) declare @UsrID as varchar(50) select @ModStr=RTRIM(CONVERT(VarChar,@ModID)) select @JobStr=RTrim(Convert(VarChar,@JobStatus)) select @UsrID=rtrim(convert(varchar,@ReqUserID)) set @query = 'SELECT JobID,JobCode,JobName,ProgramDept,ProjectContact,ApprovalList,TBICopy,TBICopyProvBy,TBICopyAttach,TBILogos,TBILogosProvBy,TBILogosAttach,TBIImages,TBIImagesProvBy,TBIImagesAttach,TBISpecs,TBISpecsProvBy,TBISpecsAttach,Description,QuoteRequired,InHouse,CopyDue,FirstComp,ToClient,Delivery,ToSeparator,Quantity,ShipTo,MiscNotes,DateOpened,PreviousArtist,Artist,RequestingUserID,JobStatus,JobNumber,ModuleID FROM IRIS_User.DNN_T_CSRequest WHERE IRIS_User.DNN_T_CSRequest.ModuleID=' @Modstr ' AND IRIS_User.DNN_T_CSRequest.JobStatus=' @JobStr ' AND IRIS_User.DNN_T_CSRequest.RequestingUserID=' @UsrID ' ORDER BY ' @qSortBy ' ' @qOrderBy execute (@query) System.Data.SqlClient.SqlException: Line 13: Incorrect syntax near '@Modstr'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE IRIS_User.DNN_spCSRequestGetAll_byUser @ModID int, @ReqUserID int, @qSortBy varchar(20), @qOrderBy varchar(10) AS declare @query varchar(2000) declare @ModStr varchar(50) declare @UsrStr varchar (50) select @ModStr=RTRIM(CONVERT(VarChar,@ModID)) select @UsrStr=RTrim(Convert(VarChar,@ReqUserID)) set @query = 'SELECT JobID,JobCode,JobName,ProgramDept,ProjectContact,ApprovalList,TBICopy,TBICopyProvBy,TBICopyAttach,TBILogos,TBILogosProvBy,TBILogosAttach,TBIImages,TBIImagesProvBy,TBIImagesAttach,TBISpecs,TBISpecsProvBy,TBISpecsAttach,Description,QuoteRequired,InHouse,CopyDue,FirstComp,ToClient,Delivery,ToSeparator,Quantity,ShipTo,MiscNotes,DateOpened,PreviousArtist,Artist,RequestingUserID,JobStatus,JobNumber,ModuleID FROM IRIS_User.DNN_T_CSRequest WHERE IRIS_User.DNN_T_CSRequest.ModuleID=' @Modstr ' AND IRIS_User.DNN_T_CSRequest.RequestingUserID=' @UsrStr ' ORDER BY ' @qSortBy ' ' @qOrderBy execute (@query)

Here are the two SP's in the SQLDataProvider script:

CREATE PROCEDURE {databaseOwner}{objectQualifier}spCSJobCodesGetAll
  @ModID int
 AS
 SET NOCOUNT ON
 SELECT JobCodesID,JobCode,ModuleID,JobCodeDesc,  JobCode + '-' + JobCodeDesc AS JCwDesc FROM {databaseOwner}{objectQualifier}T_CSJobCodes WHERE ModuleID=@ModID <---Don't know why it is hyperlinking this line in my post???
GO

CREATE PROCEDURE {databaseOwner}{objectQualifier}spCSRequestGetAll
  @ModID int,
  @qSortBy varchar(20),
  @qOrderBy varchar(10)
as
 declare @query varchar(2000)
             declare @ModStr varchar(50)
             select @ModStr=RTRIM(CONVERT(VarChar,@ModID))
 set @query = 'SELECT JobID,JobCode,JobName,ProgramDept,ProjectContact,ApprovalList,TBICopy,TBICopyProvBy,TBICopyAttach,TBILogos,TBILogosProvBy,TBILogosAttach,TBIImages,TBIImagesProvBy,TBIImagesAttach,TBISpecs,TBISpecsProvBy,TBISpecsAttach,Description,QuoteRequired,InHouse,CopyDue,FirstComp,ToClient,Delivery,ToSeparator,Quantity,ShipTo,MiscNotes,DateOpened,PreviousArtist,Artist,RequestingUserID,JobStatus,JobNumber,ModuleID FROM {databaseOwner}{objectQualifier}T_CSRequest WHERE {databaseOwner}{objectQualifier}T_CSRequest.ModuleID=' + @Modstr + ' ORDER BY ' + @qSortBy + ' ' + @qOrderBy

execute (@query)
GO

I know that is a lot to look at but I'm hoping someone can point me in the right direction.  I think the issue has to do with the ' and + characters but I have other SP's that use them without an issue.

Thanks,
Steve

 

 
New Post 5/17/2007 3:58 PM
User is offline Sebastian Leupold
15159 posts
www.deutschnetnuke.de
1st Ranked












Re: Problem creating SPs when installing custom module 

make sure, you save your scipt with UTF-8 encoding.


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 5/18/2007 8:24 AM
User is offline Mitch Sellers
5712 posts
www.mitchelsellers.com
3rd Ranked




Re: Problem creating SPs when installing custom module 

As mentioned above I would check the encoding of your saved script.  Most likely it is not liking the ' character.


-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 5/18/2007 8:51 AM
User is offline Steve Wyatt
4 posts
10th Ranked


Re: Problem creating SPs when installing custom module 

That was it guys!  Thanks so much for the help.  I'm a bit new to this and had not run across this issue before.

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Problem creating SPs when installing custom module
 


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.

 


DotNetNuke Web Hosting w/ ASP.NET 3.5
Unlimited email boxes, Unlimited databases, Unlimited domains. Plans start at $4.97
www.MyWinHosting.com
SteadyRain
Founded in 1999, SteadyRain has extensive experience delivering Internet technology strategies and solutions for a diverse client base, ranging from Fortune 500 firms to successful start-ups.
www.steadyrain.com
AfterImage Internet Consulting and SEO Services
AfterImage provides search engine optimization (SEO), Internet consulting and hosting services for the Windows platform (IIS, ASP, SQL Server).
www.afterimage.nl/

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