1

When DbUp executes the following SQL script, I get an error as shown further down:

CREATE OR REPLACE PROCEDURE INVOICE_DELETE
    (PAR_INVOICE_ID IN NUMBER)
AS 
BEGIN   
    DELETE FROM INVOICE_SECT_ACCOUNTING_DATA
    WHERE INVOICE_ID = PAR_INVOICE_ID;
    
    DELETE FROM INVOICE
    WHERE INVOICE_ID = PAR_INVOICE_ID;
    
    COMMIT;
      
END INVOICE_DELETE;

Oracle error code: 1; Number -2147467259; Message: 904
Oracle.ManagedDataAccess.Client.OracleException (0x80004005):
ORA-00904: "PAR_INVOICE_ID": niepoprawny identyfikator

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Igor Semkiv
  • 251
  • 2
  • 11
  • Can you show the definition of the tables? Also "niepoprawny identyfikator" - please translate to English thanks – OldProgrammer Mar 29 '21 at 15:28
  • 1
    ORA-00904 is "invalid identifier" – EJ Egyed Mar 29 '21 at 16:20
  • The error states that it was unable to find the column. Cross-check the tables INVOICE_SECT_ACCOUNTING_DATA and INVOICE for column "INVOICE_ID" – sandy v Mar 29 '21 at 16:36
  • 2
    [The documentation](https://dbup.readthedocs.io/en/latest/supported-databases/) suggests DbUp doesn't support Oracle. I suspect either the PL/SQL syntax or (maybe) the blank line is confusing it, and it's effectively running one of the `delete` statements - in that context the error would make sense, as the table doesn't have a column called `par_invoice_id`. – Alex Poole Mar 29 '21 at 16:43
  • By the way, you can't alter a procedure. You can only create or replace it. – William Robertson Mar 29 '21 at 19:21

1 Answers1

0

DbUp-Oracle has 2 buiders: OracleDatabaseWithDefaultDelimiter and OracleDatabaseWithSemicolonDelimiter - https://github.com/DbUp/DbUp/pull/335.

My bad because I used OracleDatabaseWithSemicolonDelimiter. So DbUp splits my procedure into pieces.

Igor Semkiv
  • 251
  • 2
  • 11