Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 705843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:05:56+00:00 2026-05-14T04:05:56+00:00

I’m trying to build a test environment to test an app against oracle and

  • 0

I’m trying to build a test environment to test an app against oracle and sql server. The aim is to have the same code base for both test scenarios, the only difference should are some SQL/DDL/… statements that are stored in script files. The problem is that oracle’s ODP does not support the execution of scripts but only single commands.

I found a workaround, but there is still one issue that I can’t get solved:

My Drop script for oracle looks like this:

BEGIN EXECUTE IMMEDIATE 'SELECT ''DROP TABLE '' || table_name || '' CASCADE CONSTRAINTS;'' FROM  user_tables'; EXECUTE IMMEDIATE 'SELECT ''DROP SEQUENCE '' || sequence_name || '';'' FROM user_sequences;'; END[;]

The problem is the last semicolon after the END:

While the oracle database complains if I don’t provide the semicolon at the end:

ORA-06550: line 1, column 208:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
; <an identifier> <a double-quoted delimited-identifier>
The symbol ";" was substituted for "end-of-file" to continue.)

I get an exception thrown by the oracle ODP .Net command object if I provide the semicolon:

ORA-00911: invalid character
ORA-06512: at line 1 

Is there a way to satisfy both, the oracle data base and ODP .Net?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:05:57+00:00Added an answer on May 14, 2026 at 4:05 am

    I think the semicolon issue may actually reside in the second execute immediate. When you’re running SQL in execute immediate like this, putting a semicolon at the end of the string will cause an error.

    However, this PL/SQL block won’t actually do anything. Issuing selects inside a PL/SQL block without an INTO clause runs the query, but does nothing with the results. I think what you really want is something like this:

    DECLARE
       cursor cur_tables is 
          select 'drop table ' || table_name || ' cascade constraints' as qry
          from user_tables;
       cursor cur_sequences is 
          select 'drop sequence ' || sequence_name as qry
          from user_sequences;
    BEGIN
       for r_table in cur_tables loop
          execute immediate r_table.qry;
       end loop;
       for r_sequence in cur_sequences loop
          execute immediate r_sequence.qry;
       end loop;
    END;
    

    There’s really no reason to make the selects dynamic, as they aren’t changing. Your dynamic SQL is actually the drop statements that you’re querying for.

    Added commentary: You shouldn’t need to wrap it in an execute immediate to run it from .NET. You should be able to pass the block to the database as a string without any changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.