MoGol
MoGol

Reputation: 103

Flyway give ORA-00900 when I try to EXEC stored procedure from package

I have some oracle sql scripts, which run perfectly from SQLDeveloper or from SQLPlus. Now I want to implement Flyway tool to control DB migration. But when I try to execute following string

EXEC USERNAME.PA_SECURITY.SP_TBL_PLC_ADD('V_NAME', USERNAME.PA_SECURITY.POLICY_NAME);

I got an error ORA-00900 : invalid SQL statement. From flyway documentation I don't see any restrictions for using SP. But I don't understand, what is wrong with my SQL. It's working with other tools.

Upvotes: 2

Views: 2025

Answers (1)

MoGol
MoGol

Reputation: 103

As a_horse_with_no_name explain I need to use following syntax

BEGIN 
   USERNAME.PA_SECURITY.SP_TBL_PLC_ADD('V_NAME', USERNAME.PA_SECURITY.POLICY_NAME);
END;

i.e. remove EXEC statement and add "BEGIN ... END;" frame.

Upvotes: 1

Related Questions