[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2010-09-12
6
Medium Priority
?
390 Views
Last Modified: 2013-12-17
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
Comment
Question by:gudidi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 1000 total points
ID: 33656685
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
 

Author Comment

by:gudidi
ID: 33656931
i still have the same error
0
 
LVL 20

Assisted Solution

by:flow01
flow01 earned 1000 total points
ID: 33658098
change it to
BEGIN
   DBMS_DDL.alter_compile('PROCEDURE','DD20','RANGE1');
END;
to create a valid pl/sql block
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 74

Expert Comment

by:sdstuber
ID: 33658394
how are you invoking this?

what are the c# command object parameters you are using?
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 33661371
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
 

Author Comment

by:gudidi
ID: 33670222
the problem solved with:

ALTER PROCEDURE RANGE1 COMPILE

10x
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question