| |
|
|
|
|
|
|
|
|
|
 |    |  |
 | |  |
 | |  |
 | |  |
 | |  |
 |
|
|
| 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
|
|
|
|
 |  |
|
|
| Re: Problem creating SPs when installing custom module |
|
|
|
|
 |  |
|
|
| 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.

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