IntelliJ Java IDE
The moose likes Oracle/OAS and the fly likes Stupid Sql*Plus unix question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Reply Bookmark "Stupid Sql*Plus unix question" Watch "Stupid Sql*Plus unix question" New topic
Author

Stupid Sql*Plus unix question

sonny kher
Ranch Hand

Joined: Nov 06, 2001
Posts: 83
how do you edit the last command in sql* under unix? when i do ed i get into a mode that i can't get out of. How does it work, its a bitch since most of the del/backspace keys aren't working for me.


_ __________________ _ <br />RHCE<br />SCJP<br />??:-(
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1177

You can read about the UNIX 'ed' command here: http://unixhelp.ed.ac.uk/CGI/man-cgi?ed
Rene


Regards, Rene Larsen
Dropbox Invite
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1177

or you can define your own editor like this:
SQL> define_editor="vi"
SQL> select * from tableA;
SQL> ed
Rene
sonny kher
Ranch Hand

Joined: Nov 06, 2001
Posts: 83
perfect, thanks rene
one more thing. how do I start the oracle control center in unix/linux (thats whats its called right)
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

sonny that editor is vi.
some simple vi commands, since I am not an expert in vi but able to make simple edits.
keys
you start in regular mode, you can't edit this way.
If you want to delete a character you move the cursor to that character with the arrow keys. Then you press the 'x' key and it will delete that character.
the 'd' key twice will remove the entire line.
To add characters you need to go to insert mode.
The 'i' key will put you in insert mode, now here is the tricky part, you will stay in insert mode until you press the 'esc' key, which takes you out of insert mode. When you are in insert mode you can't use any opther keys, like the 'x' to remove a character, if you are in insert mode and hit the 'x' key and 'x' will appear in your text.
Now the last thing to know is to exit you need to be in the regular mode. the you press the shift and then the ';' key, then you will put 'wq' in the screen and it will exit you out of vi and back into sqlplus with the new statement.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1177

Now the last thing to know is to exit you need to be in the regular mode. the you press the shift and then the ';' key, then you will put 'wq' in the screen and it will exit you out of vi and back into sqlplus with the new statement.

Just for the record ;-)
After you have pressed the shift you should then press the ':' key
Rene
[ October 31, 2002: Message edited by: Rene Larsen ]
Lipman Li
Ranch Hand

Joined: May 02, 2002
Posts: 122
Originally posted by Rene Larsen:

Just for the record ;-)
After you have pressed the shift you should then press the ':' key
Rene
[ October 31, 2002: Message edited by: Rene Larsen ]

very funny, in my keyboard, ':' and ';' are located in the same key.
vi is the favorite editor for UNIX guys, even there's a lot IDE like editor available now. actually, you could edit a file much faster by using vi than other GUI editor. If one person could use vi very skillfully, He probably is UNIX knowledgeable.
last time, I interview a candidate to ask him to edit a file by using vi, as he declare he is very familiar with UNIX.
 
IntelliJ Java IDE
 
subject: Stupid Sql*Plus unix question
 
Threads others viewed
Unix shell script - oracle function
jdbc connection with mysql on unix
How to get simple SQL implementation access in my webspace
unix and sql in testing
java on Unix
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture