SAP Knowledge Base Article - Preview

2732864 - Incorrect syntax errors on stored procedures when trying to recompile, original code has no issues - SAP ASE

Symptom

  • sp_showtext (or sp_helptext) shows incorrect syntax in a stored procedure, for example: 

    sp_showtext p2
    go

    create proc p2
    as
    declare @val int
    declare c cursor for select id from sysobjects
    open c
    fetch c into @val
    while (@@sqlstatus !=2)
    begin
    print "in cursor"
    if 1=1
    begin
    print "in if clause"
    end
         fetch         c into @val
    end

    dbcc upgrade_object (pubs2, p2, 'check')
    go

    Msg 102, Level 15, State 181:
    Server 'myASE', Procedure 'p2', Line 15:
    Incorrect syntax near 'fetnd'.
    Msg 11031, Level 16, State 1:
    Server 'myASE', Procedure 'p2', Line 15:
    Execution of procedure p2 failed because of errors parsing the source text in syscomments during upgrade. Please drop and recreate dbo.p2.
     
  • Same issue is seen when using ddlgen.
     
  • This issue does NOT happen in
    • SAP ASE 15.7 SP139 and lower
    • SAP ASE 16.0 SP03 PL03 and lower


Read more...

Environment

  • SAP Adaptive Server Enterprise (ASE) 16.0 SP03 PL04 and above
  • SAP Adaptive Server Enterprise (ASE) 15.7 SP140 and above
  • High Availability Disaster Recovery (HADR)

Product

SAP Adaptive Server Enterprise 15.7 ; SAP Adaptive Server Enterprise 16.0

Keywords

817723, CR817723, CR#817723, extra spaces, tab, wrong behavior, compiled, compile, migration, keywords, whitespace, CR817869, CR#817869, 817869, CR813005, CR#813005, 813005, 156, missing end comments mark , KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , Bug Filed

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.