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
Solved

execute script from sqlplus command line

Posted on 2007-11-15
2
39,457 Views
Last Modified: 2013-12-19
Hi,

I execute sqlplus myuser/mypassword@myhost @c:\temp\batchtest.sql

In the batchtest.sql, I have this :

spool C:\Temp\test1.txt
@C:\Temp\testphm.sql
spool off
exit


In the testphm.sql, I have this :

DECLARE
tbl_exist PLS_INTEGER;
BEGIN
SELECT COUNT(*) INTO tbl_exist FROM user_tables WHERE table_name = 'ADP';
END;

When I execute the prompt is like this :

Connected to:
Oracle9i Release 9.2.0.8.0 - Production
JServer Release 9.2.0.8.0 - Production

  8

It's stop with this "8" which seems the last line number of the script...

Any idea ?

TIA.
0
Comment
Question by:s2000_com
2 Comments
 
LVL 1

Accepted Solution

by:
bobbymanocha earned 250 total points
ID: 20289266
Add a / at the end of the PL/SQL block, like so:

DECLARE
tbl_exist PLS_INTEGER;
BEGIN
SELECT COUNT(*) INTO tbl_exist FROM user_tables WHERE table_name = 'ADP';
END;
/
0
 

Author Comment

by:s2000_com
ID: 20289308
Thanks a lot !
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

838 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