Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

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
0
gudidi
Asked:
gudidi
2 Solutions
 
sdstuberCommented:
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
 
flow01Commented:
change it to
BEGIN
   DBMS_DDL.alter_compile('PROCEDURE','DD20','RANGE1');
END;
to create a valid pl/sql block
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now