문제

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