Skip to Content

HANA: Drop and Create an existing stored procedure in transaction

Hi, I'm working on an addon wich applies db updates on start.

I need to update an existing stored procedure. So:

Company.StartTransaction()
rs.DoQuery("DROP PROCEDURE MySp")
rs.DoQuery("CREATE PROCEDURE MySp"...)
Company.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)

When CREATE PROCEDURE is executed i get this error:
1). [SAP AG][LIBODBCHDB32 DLL][HDBODBC32] General error;329 cannot use duplicate name of function or procedure: MySp

Removing transactions works.
Seems HANA is not able to 'see' the drop when inside a transaction.
I need to use transactions because if create fails for some reasons SP is definitely dropped..

With SQL Server I have no problem.

Please help.

Thank you

Paolo

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 26, 2017 at 12:59 PM

    Hi Paolo,

    Is ALTER procedure not a possibility?

    Pedro Magueija

    LinkedIn | Twitter | Blog

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Paolo,

      That could be it. For me it works on 1.00.122.03.1475845474 (fa/hana1sp12) but it does not work on 1.00.102.03.1449674847 (fa/newdb100_maint_rel).

      Perhaps the ALTER PROCEDURE was only implemented after your version.

      Is updating the system a possibility for you?

      Pedro Magueija

      LinkedIn | Twitter | Blog