Solved

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

Posted on 2010-09-12
6
388 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 250 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 250 total points
ID: 33658098
change it to
BEGIN
   DBMS_DDL.alter_compile('PROCEDURE','DD20','RANGE1');
END;
to create a valid pl/sql block
0
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!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the dā€¦
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

724 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