SAP Knowledge Base Article - Preview

2732864 - Errors (incorrect syntax) on stored procedures when trying to recompile, original code does not have 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
         fetnd
         fetch         c into @val
    end

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

    Msg 102, Level 15, State 181:
    Server 'da_prime', Procedure 'p2', Line 15:
    Incorrect syntax near 'fetnd'.
    Msg 11031, Level 16, State 1:
    Server 'da_prime', 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
    • ASE 15.7 SP139 and lower
    • 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

Product

SAP Adaptive Server Enterprise 16.0

Keywords

817723, CR817723, CR#817723, extra spaces, tab, wrong behavior, compiled, compile, syscomments, migration, keywords whitespace , 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.