1

I have Sqlplus installed and ran a batch file below in cmd.

"D:\setups\instantclient_11_2\sqlplus.exe" username/password@"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=111.111.111.11) (PORT=1521)))(CONNECT_DATA=(SID=orcl)))"  @"E:\sql scripts\procedure.sql"

This is what I got. And my procedure means to insert records into a table but that table is still empty.

E:\p01-material big data projects\batch>sql.bat

SQL*Plus: Release 11.2.0.4.0 Production on 星期四 1月 25 11:22:29 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
  6

It stays here forever. And the 6 is here probably because my sql file procedure.sql has 6 lines of statement. How can I make this work?

Thanks

2
  • Brackets have meaning in batch. Escape them with the caret ^. Commented Jan 25, 2018 at 5:50
  • @ACatInLove, yes and no, not in this case as it is wrapped in double quotes and is seen as the next command after sqlplus Commented Jan 25, 2018 at 7:13

1 Answer 1

1

The last line in your PROCEDURE.SQL should be a forward slash, /. It shows SQL*Plus that you've terminated the procedure and will run it.

Or, when you see that "6" (it is the line number; SQL*Plus waits you to enter something), enter / and press "Enter" key on the keyboard.

Sign up to request clarification or add additional context in comments.

1 Comment

Sure it did! Those are little tricks that people who grew up on SQL*Plus know :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.