I am taking a database class and we are using oracle sqlplus. I have worked with many different database management systems before and several different flavors of SQL but I am having trouble doing something incredibly simple it would seem. I am trying to use the editor in sqlplus by typing into sqlplus SQL> ED, which works but then I can't find any way to save the file once I am done writing my script. I'm sure this is incredibly simple but it's hard to find anything online that tells how to save a file once you are in the editor. I am just trying to copy and paste my script in from notepad basically and save it using the editor so I can run it to create several tables at once.

有帮助吗?

解决方案

You can save it as script.sql and then run it using sqlplus @script.sql.

For example echo "SELECT * FROM table" > script.sql and then sqlplus user/pass@db @script.sql.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top