Solved

execute script from sqlplus command line

Posted on 2007-11-15
2
39,409 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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
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…
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.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now