Question

Calling a Text File from SQL Plus

Rating9.4Excellent

I am trying to delete a bunch of tables from an Oracle databse using SQL Plus.  

I have written the following script into a text file:

DROP TABLE test1;
/
DROP TABLE test2;
/

This file is saved directly to the root. (c:drop.sql).  To call this file from SQL Plus I have been advized to use the following script:

SQL> @drop.sql;

But...  i am getting an error:
SP2-0310: Unable to Open File "DROP.SQL"

Have i missed something in the text file or when calling it from the script?


  1. Calling a Text File from SQL Plus
    I am trying to delete a bunch of tables from an Oracle databse using SQL Plus. I have written the following script into a text file: DROP TABLE test1; / DROP TABLE test2; / This file is saved directly to the root. (c:drop.sql). To call this file from SQL Plus I have been advized to use the following script: SQL> …
  2. create .SQL file
    i have windows xp and likes to create a .sql file to create a script for oracle but its creating normal text file instead of ".SQL" file. How to create ".SQL" file on windows
  3. Create a SQL Script Which Takes a text file as in…
    Hello, I would like to create a SQL statement that reads data from a file and updates records in a database table. Is this possible if so can someone please provide me with some sample code. The scenario is detailed below. Thanks. I have a text file (which can be comma delimited) containing 160 user id's (6 digits long). I want to run a one o…
  4. database hanging on drop table that is empty
    database is hanging on drop table that is empty
  5. How to restore an Oracle 10 g database .dmp …
    I need to know the exact syntax to restore an oracle database from a .dmp file from the SQL Plus command prompt.

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
file open plus sql
Participating Experts
2
Solution Grade
A

Replies

 
by: geotiger

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by:

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: tomhigh

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: markgeer

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: tomhigh

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert