Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL Not Executing via Windows Batch Script

a7cf24e8-4a7a-4681-b47f-5035b4272839Sep 18 2019 — edited Sep 18 2019

Hi All - Got a bizarre issue that's puzzling me. Hopefully it's simple to sort out or at least begin to troubleshoot

Oracle DB 11.2.0.4 / Windows 2008 R2

I have a stored procedure that's not doing anything very complicated. Selecting some values, comparing some values, inserting into a table.

If I open command prompt and run the stored procedure manually via SQLPlus everything works normally. Something along the lines of:

set oracle_sid=DBNAME

sqlplus

username

password

exec procedureName();

However, if I do the same thing via a Windows batch file I get a message saying "PL/SQL procedure successfully completed" but the stored procedure does not appear to have executed.

The batch file is structured as:

sqlplus username/password@DBNAME @C:\SomeSQL.sql

With the SQL file containing:

exec procedureName();

What's the obvious thing I've missed?

Thank you

Comments
Post Details
Added on Sep 18 2019
5 comments
1,306 views