LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2009, 04:28 PM   #1
indubitableness
Member
 
Registered: Feb 2009
Distribution: Slackware64 14.0 multilib
Posts: 62

Rep: Reputation: 15
Why won't sqlplus give me a command history?


I was using oracle 11g on a windows vm. The vm broke itself to an irreparable state and I decided I would use a slackware VM so I can maintain a usable install of 11g.

After a pain in the ass of a time I got it running. I am doing homework and when I press up to edit a command I've given previously all I get is ^[[A. I can't even use home or end keys.

Why can't I get a history on sqlplus? I'm used to just being able to push "up." I can't even paste code in with the intention of editing it because it runs it immediately and fails. Even when I edit it in an editor and paste it it seems to detect line breaks or something and errors out.
 
Old 11-11-2009, 05:07 PM   #2
pattwo
LQ Newbie
 
Registered: Jun 2008
Location: Ontario, Canada
Distribution: Slackware, Fedora, RHEL
Posts: 7

Rep: Reputation: 5
Hi

You must remember that SQLPlus is not your shell. It doesn't have the same capabilities.

Oracle sqlplus documentation here.

You're probably better off doing your editing in an editor and running the script from sqlplus. Something like:
Code:
sqlplus username/password @name_of_file_containing_sql_script
 
Old 11-11-2009, 10:23 PM   #3
indubitableness
Member
 
Registered: Feb 2009
Distribution: Slackware64 14.0 multilib
Posts: 62

Original Poster
Rep: Reputation: 15
It can do it in windows so I'm kind of confident it must work in linux. There's got to be some kind of command history file I can set with an environment variable or something.

HAZAAH I am [edit] apparently not [edit] victorious!

Quote:
Standard command history

It is very important to use a common set of UNIX command history and command editing keystrokes. By adding the following command to your .profile, you instruct UNIX to use the vi command editor from your UNIX prompt

#*****************************************************************
# Keyboard commands
#*****************************************************************
stty erase ^?
set -o vi
The set –o vi command enables the following UNIX keystrokes for quickly locating and re-executing UNIX commands:
* <esc> k – Page through previous commands
* <esc> \ - Search the command history for a command with a string
* <esc> \ - automatic command completion for file names

Having a common editor between Oracle servers ensures the common look-and-feel regardless of the current Oracle server.
Source: http://www.rampant-books.com/op_unix...tor_prompt.htm

Quote:
The above is an excerpt from the "Oracle9i UNIX Administration Handbook" by Oracle press, authored by Donald K. Burleson.

Last edited by indubitableness; 11-12-2009 at 01:19 AM.
 
Old 11-12-2009, 01:34 AM   #4
indubitableness
Member
 
Registered: Feb 2009
Distribution: Slackware64 14.0 multilib
Posts: 62

Original Poster
Rep: Reputation: 15
Okay last thing didn't work. Don't know what I'm doing with the vi stuff. I found this:

http://utopia.knoware.nl/~hlub/rlwrap/man.html

Got a buildscript from slackbuilds.org and used it. Works perfectly. All is right with the world.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 02:14 AM
sqlplus call does not come back, want quit command steve_brown Linux - Newbie 2 03-09-2006 07:42 AM
History command amer_58 Linux - General 5 06-24-2005 12:26 PM
sqlplus command from script Grassie Coetzee LinuxQuestions.org Member Intro 2 03-13-2005 12:01 PM
SQLplus command editor under UNIX - how?? stephstellar Programming 5 05-27-2003 08:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration