Solved

execute script from sqlplus command line

Posted on 2007-11-15
2
39,444 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

Suggested Solutions

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…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

770 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