Dynamic SQL statement Failed in C# - works fine in TOAD

Hi Experts

i try to recompile invalid objects of Oracle from C#  application.
on TOAD and SQL+ it works fine
from C# i get error of  : ora-0900 sql  invalid statement\n

this is the script:  EXEC DBMS_DDL.alter_compile('PROCEDURE','DD20','RANGE1');

10x in advance
gudidiAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
sdstuberConnect With a Mentor Commented:
don't use "exec"

that is a SQL*PLUS command that is replicated in Toad,  it's not really a sql or pl/sql command

just invoke the dbms_ddl procedure itself
0
 
gudidiAuthor Commented:
i still have the same error
0
 
flow01Connect With a Mentor Commented:
change it to
BEGIN
   DBMS_DDL.alter_compile('PROCEDURE','DD20','RANGE1');
END;
to create a valid pl/sql block
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
sdstuberCommented:
how are you invoking this?

what are the c# command object parameters you are using?
0
 
slightwv (䄆 Netminder) Commented:
I typically get that error when I forget and leave the semi-colon at the end of the command.

If this doesn't fix it, please post the code that you are using.
0
 
gudidiAuthor Commented:
the problem solved with:

ALTER PROCEDURE RANGE1 COMPILE

10x
0
All Courses

From novice to tech pro — start learning today.