Must declare the scalar variable "@PathId".

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
2/13/2010 8:02:57 AM
Gravatar
Total Posts 2

Must declare the scalar variable "@PathId".

Hello I am trying to install 2.3.3.6 on MS SQL.

After doing all the installation steps I run the setup and get the following:

Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema needs to be created.
Running script mojoportal-core - 2.2.7.8 - 00:00:00.1020058
System.Data.SqlClient.SqlException: Must declare the scalar variable "@PathId". at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) at mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) - 00:00:00.9100520
 

I have setup the database to be case and accent insensitive.

Any help would be really appreciated.

 

2/13/2010 8:24:10 AM
Gravatar
Total Posts 18439

Re: Must declare the scalar variable "@PathId".

What version of MS SQL?

Do you have all the service paks installed?

2/13/2010 8:42:58 AM
Gravatar
Total Posts 2

Re: Must declare the scalar variable "@PathId".

I am using MS SQL 2005 and yes it has all the service packs.

3/22/2010 11:41:00 AM
Gravatar
Total Posts 2

Re: Must declare the scalar variable "@PathId".

Welcome to mojoPortal Setup
Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema needs to be created.
Running script mojoportal-core - 2.2.7.8 - 00:00:00.0996094
System.Data.SqlClient.SqlException: 列名 'PathId' 无效。列名 'PathId' 无效。 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) 在 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) 在 System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) 在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) 在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() 在 mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters) 在 mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) 在 mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) - 00:00:00.9755859
Note: This page shows some information that is helpful during setup and upgrades but for security it would be best not to show any information when the system is up to date. You can disable setup and suppress all information on this page by setting DisableSetup=true in Web.config. When you need to upgrade, you can set this back to false. If you are logged in as Administrator setup will run and you will be able to see this page even if it is disabled in Web.config so you can easily leave it disabled and just login before upgrading. But if you are not logged in you will need to enable setup in Web.config.
 

 

 

yes ,I had the same problem,

 

see that currentlog.config @\Data\ folder.

2010-03-23 00:24:54,000 ERROR mojoPortal.Web.BannedIPBlockingHttpModule - handled exception:
System.InvalidOperationException: 存储过程“mp_BannedIPAddresses_Exists”不存在。
在 System.Data.SqlClient.SqlCommand.DeriveParameters()
在 System.Data.SqlClient.SqlCommandBuilder.DeriveParameters(SqlCommand command)
在 mojoPortal.Data.SqlParameterHelper.DiscoverParameters(String connectionString, String procName)
在 mojoPortal.Data.SqlParameterHelper.GetParameters(String connectionString, String procName)
在 mojoPortal.Data.SqlParameterHelper.InitializeArray()
在 mojoPortal.Data.SqlParameterHelper.Initialize(String pConnectionInfo, String pCommandText, CommandType pCmdType, Int32 pParamCnt)
在 mojoPortal.Data.SqlParameterHelper..ctor(String connectionString, String commandText, Int32 paramCnt)
在 mojoPortal.Data.DBBannedIP.IsBanned(String ipAddress)
在 mojoPortal.Business.BannedIPAddress.IsBanned(String ipAddress)
在 mojoPortal.Web.BannedIPBlockingHttpModule.BeginRequest(Object sender, EventArgs e)
2010-03-23 00:24:54,592 ERROR mojoPortal.Business.WebHelpers.CacheHelper - Error trying to obtain siteSettings
System.InvalidOperationException: 存储过程“mp_Sites_SelectOneByHost”不存在。
在 System.Data.SqlClient.SqlCommand.DeriveParameters()
在 System.Data.SqlClient.SqlCommandBuilder.DeriveParameters(SqlCommand command)
在 mojoPortal.Data.SqlParameterHelper.DiscoverParameters(String connectionString, String procName)
在 mojoPortal.Data.SqlParameterHelper.GetParameters(String connectionString, String procName)
在 mojoPortal.Data.SqlParameterHelper.InitializeArray()
在 mojoPortal.Data.SqlParameterHelper.Initialize(String pConnectionInfo, String pCommandText, CommandType pCmdType, Int32 pParamCnt)
在 mojoPortal.Data.SqlParameterHelper..ctor(String connectionString, String commandText, Int32 paramCnt)
在 mojoPortal.Data.DBSiteSettings.GetSite(String hostName)
在 mojoPortal.Business.SiteSettings.GetSiteSettings(String hostName)
在 mojoPortal.Business.SiteSettings..ctor(String hostName)
在 mojoPortal.Business.WebHelpers.CacheHelper.LoadSiteSettings()
2010-03-23 00:24:54,595 ERROR mojoPortal.Web.UrlRewriter - System.NullReferenceException: 未将对象引用设置到对象的实例。
在 mojoPortal.Web.UrlRewriter.GetRedirectUrl(String targetUrl)
在 mojoPortal.Web.UrlRewriter.RewriteUrl(HttpApplication app)
2010-03-23 00:24:54,619 ERROR mojoPortal.Business.WebHelpers.CacheHelper - Error trying to obtain siteSettings
System.InvalidOperationException: 存储过程“mp_Sites_SelectOneByHost”不存在。
在 System.Data.SqlClient.SqlCommand.DeriveParameters()
在 System.Data.SqlClient.SqlCommandBuilder.DeriveParameters(SqlCommand command)
在 mojoPortal.Data.SqlParameterHelper.DiscoverParameters(String connectionString, String procName)
在 mojoPortal.Data.SqlParameterHelper.GetParameters(String connectionString, String procName)
在 mojoPortal.Data.SqlParameterHelper.InitializeArray()
在 mojoPortal.Data.SqlParameterHelper.Initialize(String pConnectionInfo, String pCommandText, CommandType pCmdType, Int32 pParamCnt)
在 mojoPortal.Data.SqlParameterHelper..ctor(String connectionString, String commandText, Int32 paramCnt)
在 mojoPortal.Data.DBSiteSettings.GetSite(String hostName)
在 mojoPortal.Business.SiteSettings.GetSiteSettings(String hostName)
在 mojoPortal.Business.SiteSettings..ctor(String hostName)
在 mojoPortal.Business.WebHelpers.CacheHelper.LoadSiteSettings()
2010-03-23 00:24:56,019 ERROR mojoPortal.Data.DBPortal - dbPortal.RunScript failed
System.Data.SqlClient.SqlException: 列名 'PathId' 无效。
列名 'PathId' 无效。
在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
在 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
在 System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
在 mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters)
在 mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo)
2010-03-23 00:24:56,021 INFO mojoPortal.Data.DBPortal - last script statement was
CREATE PROCEDURE [dbo].[mp_SitePersonalizationAdministration_FindState]


@SiteID int,
@Path nvarchar(255) = NULL,
@AllUsersScope bit,
@UserID uniqueidentifier = NULL,
@InactiveSinceDate datetime = NULL,
@PageIndex int,
@PageSize int

......

3/22/2010 11:44:26 AM
Gravatar
Total Posts 2

Re: Must declare the scalar variable "@PathId".

My IIS(Windows Server 2008 r2) dosen't set IP Binding.

Is that reason?

3/23/2010 7:00:16 AM
Gravatar
Total Posts 18439

Re: Must declare the scalar variable "@PathId".

Hi,

I think the issue is that your db is configured to be case sensitive and there are a few places in the script where case is not correct. It does not affect most people because most installations the db is not case sensitive.

If you edit the file /Setup/applications/mojoportal-core/SchemaInstallScripts/mssql/2.2.7.8.config and look for instances of "PathId" and change them to "PathID" and also a few places has UserId which should be UserID then it should get you past this error. I have made the smae fix in my copy in hopes to remove this issue for the next release.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.