My Oracle Support Banner

"Error in Run SQL Script SSPM_P151.sql: DatabaseToolException (Cannot assign a default value to a local variable.)" When Attempting to Upgrade a Database Using DBSetup.bat (Doc ID 2469779.1)

Last updated on SEPTEMBER 13, 2019

Applies to:

Primavera P6 Enterprise Project Portfolio Management - Version 15.1.0.0 and later
Primavera P6 Professional Project Management - Version 15.1.0.0 and later
Information in this document applies to any platform.

Symptoms

When attempting to upgrade a P6 EPPM 15.1 database to 18.8, using dbsetup.bat, the following error occurs:

ERROR
Error in Run SQL Script SSPM_P151.sql: DatabaseToolException (Cannot assign a default value to a local variable.)

Cannot assign a default value to a local variable.SQL Query:
DECLARE @id INT,@v_auditdata_id int,@tblexists int
declare @sql_stmt NVARCHAR(100) = 'UPDATE PRMAUDIT SET @id = auditdata_id = @id + 1';
SET @id = 0
SELECT @tblexists=count(*) FROM sys.objects where type ='U' and name ='PRMAUDIT'
IF @tblexists > 0
begin
IF COL_LENGTH('prmaudit', 'auditdata_id') IS NOT NULL
begin
  EXECUTE sp_executesql @sql_stmt, N'@id INT', @id;
  UPDATE NEXTKEY SET key_seq_num = @id + 1
  WHERE key_name = lower('PRMAUDIT_auditdata_id')
end

STEPS
The issue can be reproduced at will with the following steps:
1. Launch dbsetup.bat from the database folder.
2. Provide the database credentials.
3. Observe the upgrade fails with the reported error.

BUSINESS IMPACT
The issue has the following business impact:
Due to this issue, the database upgrade does not complete.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.