Recalling a command in sqlplus w/o retyping

Does anyone know how to recall a previous command entered at the SQLPLUS prompt w/o reentering the command, like up arrow does in MSDOS or esc K in UNIX?
Help!

If it's lhe last one just type /.
If it's an older one, always in the screen buffer U can copy and paste.
The only trick known for doing this faster is to select with the left button of the mouse, and then right click (w/o releasing the left).

Similar Messages

  • Recalling Previous commands

    Respected brothers..........
    I am working on Linux base Oracle, i have heard that there is a way of recalling previous command in SQL prompt, but i do not know can you tell me.
    Also as we can edit commands with ed in windows, can we have this type of facility in linux bases oracle.
    Let me clear my question, while working on Linux terminal we can use up and down keys to recall previous commands, how this i can do on SQL prompt.
    Edited by: user6409699 on Jul 16, 2010 12:37 AM

    user6409699 wrote:
    I am working on Linux base Oracle, i have heard that there is a way of recalling previous command in SQL prompt, but i do not know can you tell me. You need to install the rlwrap RPM or Debian package. Alternatively, you can download the source and build and install it manually.
    For details, see http://tiswww.case.edu/php/chet/readline/rltop.html
    To use. I alias commands like rman and sqlplus in +~/.bash_profile+. E.g.
    alias rman="rlwrap $ORACLE_HOME/bin/rman"
    alias sqlplus="rlwrap $ORACLE_HOME/bin/sqplus"

  • Copy command of SQLPLUS is failing

    Oracle Version 8i.
    When trying to use the copy command -in SQLPLUS- to copy the data from one database to the other, I am encountering the following error.
    Error: SP2-0027: Input is too long (> 2499 characters) - line ignored
    Reason for using the copy command is: Allows me to set commit points as against Insert into ... select * from command.
    The table, I am copying has lot of columns and the number of characters in the script are more than 3000.
    Where is the restriction of 2499 characters set? Is there a way to alter this?
    Thanks
    null

    You can export the table(s) and import into your database.

  • Running unix commands from sqlplus

    I will like to change my directory from sqlprompt. What is the command to do that?
    SQL>

    Don't think you can do what you want. The 'host' or '!' command in sqlplus spawns another shell, as soon as it returns the settings are back to the parent shell "the one that started sqlplus".

  • Executing commands in sqlplus

    I trying to get an explanation as to what is the difference between using semicolon or slash when running commands in sqlplus?
    Thx.

    ; - executes the command
    /(slash) executes the command or block in the buffer and will not display the command.
    SQL> select sysdate from dual;
    SYSDATE
    14-OCT-09
    SQL> ;
      1* select sysdate from dual
    SQL> /
    SYSDATE
    14-OCT-09-Anantha

  • SHOW commands in SQLPlus

    Where can I find a list / explanation of the SHOW commands in SQLPlus?
    Thanks,

    Hi,
    Also, try this cool glogin script from Chris Foot to show the instance name in your SQL*Plus promt:
    COLUMN file_name FORMAT a44
    COLUMN tablespace_name FORMAT a20
    COLUMN owner FORMAT a15
    COLUMN segment_name FORMAT a20
    set lines 132
    set pages 100
    set termout off
    col dbname new_value prompt_dbname
    select instance_name dbname from v$instance;
    set sqlprompt "&&prompt_dbname> "
    set termout on
    set time on
    Here are the set options:
    APPI[NFO]ON
    Application info for performance monitor (see DBMS_APPLICATION_INFO)
    ARRAY[SIZE] {15|n}
    Fetch size (1 to 5000) the number of rows that will be retrieved in one go.
    AUTO[COMMIT] OFF|n}
    Autocommit commits after each SQL command or PL/SQL block
    AUTOP[RINT] OFF
    Automatic PRINTing of bind variables.(see PRINT)
    AUTORECOVERY ON
    Configure the RECOVER command to automatically apply
    archived redo log files during recovery - without any user confirmation.
    AUTOT[RACE] OFF} [EXP[LAIN]] [STAT[ISTICS]]
    Display a trace report for SELECT, INSERT, UPDATE or DELETE statements
    EXPLAIN shows the query execution path by performing an EXPLAIN PLAN.
    STATISTICS displays SQL statement statistics.
    Using ON or TRACEONLY with no explicit options defaults to EXPLAIN STATISTICS
    BLO[CKTERMINATOR] {.|c|OFF|ON}
    Set the non-alphanumeric character used to end PL/SQL blocks to c
    CMDS[EP] {;|c|OFF|ON}
    Change or enable command separator - default is a semicolon (;)
    COLSEP { |text}
    The text to be printed between SELECTed columns normally a space.
    COM[PATIBILITY] {V5|V6|V7|V8|NATIVE}
    Version of oracle - see also init.ora COMPATIBILITY=
    You can set this back by up to 2 major versions e.g. Ora 9 supports 8 and 7
    CON[CAT] {.|c|OFF|ON}
    termination character for substitution variable reference
    default is a period.
    COPYC[OMMIT] {0|n}
    The COPY command will fetch n batches of data between commits.
    (n= 0 to 5000) the size of each fetch=ARRAYSIZE.
    If COPYCOMMIT = 0, COPY will commit just once - at the end.
    COPYTYPECHECK OFF
    Suppres the comparison of datatypes while inserting or appending to DB2
    DEF[INE] {&|c|OFF|ON}
    c = the char used to prefix substitution variables.
    ON or OFF controls whether to replace substitution variables with their values.
    (this overrides SET SCAN)
    DESCRIBE [DEPTH {1|n|ALL}][LINENUM {ON|OFF}][INDENT {ON|OFF}]
    Sets the depth of the level to which you can recursively describe an object
    (1 to 50) see the DESCRIBE command
    ECHO OFF
    Display commands as they are executed
    EMB[EDDED] OFF
    OFF = report printing will start at the top of a new page.
    ON = report printing may begin anywhere on a page.
    ESC[APE] {\|c|OFF|ON}
    Defines the escape character. OFF undefines. ON enables.
    FEED[BACK] {6|n|OFF|ON}
    Display the number of records returned (when rows > n )
    OFF (or n=0) turns the display off
    ON sets n=1
    FLAGGER OFF|FULL}
    Checks to make sure that SQL statements conform to the ANSI/ISO SQL92 standard.
    non-standard constructs are flagged as errors and displayed
    See also ALTER SESSION SET FLAGGER.
    FLU[SH] OFF
    Buffer display output (OS)
    (no longer used in Oracle 9)
    HEA[DING] OFF
    print column headings
    HEADS[EP] {||c|OFF|ON}
    Define the heading separator character (used to divide a column heading onto > one line.)
    OFF will actually print the heading separator char
    see also: COLUMN command
    INSTANCE [instance_path|LOCAL]
    Change the default instance for your session, this command may only be issued when
    not already connected and requires Net8
    LIN[ESIZE] {150|n}
    Width of a line (before wrapping to the next line)
    Earlier versions default to 80, Oracle 9 is 150
    LOBOF[FSET] n
    Starting position from which CLOB and NCLOB data is retrieved and displayed
    LOGSOURCE [pathname]
    Change the location from which archive logs are retrieved during recovery
    normally taken from LOG_ARCHIVE_DEST
    LONG {80|n}
    Set the maximum width (in chars) for displaying and copying LONG values.
    LONGC[HUNKSIZE] {80|n}
    Set the fetch size (in chars) for retrieving LONG values.
    MARK[UP] HTML ON
    [HEAD text] [BODY text] [TABLE text]
    [ENTMAP {ON|OFF}][SPOOL {ON|OFF}]
    [PRE[FORMAT] ON]
    Output HTML text, which is the output used by iSQL*Plus.
    NEWP[AGE] {1|n} NULL text
    The number of blank lines between the top of each page and the top title.
    0 = a formfeed between pages.
    NULL text
    Replace a null value with 'text'
    The NULL clause of the COLUMN command will override this for a given column.
    NUMF[ORMAT] format
    The default number format.
    see COLUMN FORMAT.
    NUM[WIDTH] {10|n}
    The default width for displaying numbers.
    PAGES[IZE] {14|n}
    The height of the page - number of lines.
    0 will suppress all headings, page breaks, titles
    PAU[SE] OFF
    press [Return] after each page
    enclose text in single quotes
    RECSEP {WR[APPED]|EA[CH]|OFF}
    Print a single line of the RECSEPCHAR between each record.
    WRAPPED = print only for wrapped lines
    EACH=print for every row
    RECSEPCHAR {_|c}
    Define the RECSEPCHAR character, default= ' '
    SCAN OFF
    OFF = disable substitution variables and parameters
    SERVEROUT[PUT] OFF [SIZE n] [FOR[MAT] {WRA[PPED]|WOR[D_WRAPPED]|TRU[NCATED]}]
    whether to display the output of stored procedures (or PL/SQL blocks)
    i.e., DBMS_OUTPUT.PUT_LINE
    SIZE = buffer size (2000-1,000,000) bytes
    SHOW[MODE] OFF
    Display old and new settings of a system variable
    SPA[CE] {1|n}
    The number of spaces between columns in output (1-10)
    SQLBL[ANKLINES] ON
    Allow blank lines within an SQL command. reverts to OFF after the curent command/block.
    SQLC[ASE] {MIX[ED]|LO[WER]|UP[PER]}
    Convert the case of SQL commands and PL/SQL blocks
    (but not the SQL buffer itself)
    SQLPLUSCOMPAT[IBILITY] {x.y[.z]}
    Set the behavior or output format of VARIABLE to that of the
    release or version specified by x.y[.z].
    SQLCO[NTINUE] {> |text}
    Continuation prompt (used when a command is continued on an additional line using a hyphen -)
    SQLN[UMBER] OFF
    Set the prompt for the second and subsequent lines of a command or PL/SQL block.
    ON = set the SQL prompt = the line number.
    OFF = set the SQL prompt = SQLPROMPT.
    SQLPRE[FIX] {#|c}
    set a non-alphanumeric prefix char for immediately executing one line of SQL (#)
    SQLP[ROMPT] {SQL>|text}
    Set the command prompt.
    SQLT[ERMINATOR] {;|c|OFF|ON}|
    Set the char used to end and execute SQL commands to c.
    OFF disables the command terminator - use an empty line instead.
    ON resets the terminator to the default semicolon (;).
    SUF[FIX] SQL
    Default file extension for SQL scripts
    TAB OFF
    Format white space in terminal output.
    OFF = use spaces to format white space.
    ON = use the TAB char.
    Note this does not apply to spooled output files.
    The default is system-dependent. Enter SHOW TAB to see the default value.
    TERM[OUT] OFF
    OFF suppresses the display of output from a command file
    ON displays the output.
    TERMOUT OFF does not affect the output from commands entered interactively.
    TI[ME] OFF
    Display the time at the command prompt.
    TIMI[NG] OFF
    ON = display timing statistics for each SQL command or PL/SQL block run.
    OFF = suppress timing statistics
    TRIM[OUT] OFF
    Display trailing blanks at the end of each line.
    ON = remove blanks, improving performance
    OFF = display blanks.
    This does not affect spooled output.
    SQL*Plus ignores TRIMOUT ON unless you set TAB ON.
    TRIMS[POOL] ON
    Allows trailing blanks at the end of each spooled line.
    This does not affect terminal output.
    UND[ERLINE] {-|c|ON|OFF}
    Set the char used to underline column headings to c.
    VER[IFY] OFF
    ON = list the text of a command before and after replacing substitution variables with values.
    OFF = dont display the command.
    WRA[P] OFF
    Controls whether to truncate or wrap the display of long lines.
    OFF = truncate
    ON = wrap to the next line
    The COLUMN command (WRAPPED and TRUNCATED clause) can override this for specific columns.

  • Copy command in Sqlplus

    I am using 8.1.6 and 8.1.7, but the copy command does not seem to work on either cases, the sqlplus just crash, did you guys have the similar problem? Is it a bug in oracle or there is some parameter I need to set up correctly?
    Your help is highly appreciated.

    it works i tried
    null

  • Call unix command in sqlplus script

    Hello, I wanna to know how to call a unix command in the sqlplus script.
    For exemple,
    I've a sqlplus script to lauch a oracle report, after the report is generated, I wanne to replace the output file in an other directory.
    So that, I have to call the unix command mv here in the sqlplus script
    How can I do it?**
    I completed my situation:
    I don't have dbms_scheduler untility in my database.
    Thanks a lot for your help
    Edited by: user11930885 on 17 janv. 2010 14:53

    Yes, at the begining, I'll tried the unix shell by calling SQL.
    I've the problem of passing the parameters through.
    It seems to me
    we can use
    Host in the SQLPLUS to run the unix command.
    but I've written it in my sqlplus script, it doesn't work. so I wanna to find an exemple how to use HOST in sqlplus script?
    I would have loved to give you an example..but its not unix on my laptop.
    But what i can tell you is...u should be doing otherway round.
    Not calling Unix commands from SQL but calling SQL's form unix.
    You got shell scripts for that.
    Write a shell script. Login to SQL execute your code.
    exit from sql and then move your file with MV. That's it.
    Do post how far you get after trying this.

  • Host command from sqlplus based on a condition

    I am on an Oracle 10.2.0.3.0 database running on sun solaris.
    Am using my sqlplusw on my windows xp professional to do the below :
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for Solaris: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    I have 4 variables declared in sqlplus for which I get my values from anonymous pl/sql blocks :
    print db1_status;
    DB1_STATUS
    3
    print db2_status;
    DB2_STATUS
    0
    print db3_status;
    DB3_STATUS
    1
    print db4_status;
    DB4_STATUS
    0
    I needed some help with doing this :
    Based on the values of each these variables, I wanted to invoke the host command to run stuff like
    if db1_status = 3 then
    host ...something
    if db2_status = 0 then
    host ...something
    I am looking for a way to do this without creating an external procedure or java stored programs. Are there any?
    Thanks

    Need to use a batch file (.bat) to utilize SQL Plus while generating the SQL statements within the .bat file.
    Example:
    Inside SQL Plus
    SQL> create table testme (name varchar2(255), value number(5));
    Table created.
    SQL> insert into testme(name, value) values ('db1_status', 3);
    1 row created.
    SQL> insert into testme(name, value) values ('db2_status', 0);
    1 row created.Create a .bat file (Using test.bat)
    test.bat
    @echo off
    echo select value from testme where name = 'db1_status';>temp.sql
    echo exit >> temp.sql
    sqlplus -S %2/%3@%1 @temp.sql > result.dat
    for /f %%x in ('more result.dat') do set RESULT=%%x
    if "%RESULT%" == "3" goto :DB1_STATUS_3
    if not "%RESULT%" == "3" goto :DB1_STATUS_NOT_3
    goto :EOF
    :DB1_STATUS_3
    echo db1_status = 3
    **ENTER SYS COMMANDS HERE**
    goto :EOF
    :DB1_STATUS_NOT_3
    echo db1_status != 3
    **ENTER SYS COMMANDS HERE**
    goto :EOF
    echo select value from testme where name = 'db2_status';>temp.sql
    echo exit >> temp.sql
    sqlplus -S %2/%3@%1 @temp.sql > result.dat
    for /f %%x in ('more result.dat') do set RESULT=%%x
    if "%RESULT%" == "0" goto :DB2_STATUS_0
    if not "%RESULT%" == "0" goto :DB2_STATUS_NOT_0
    goto :EOF
    :DB2_STATUS_0
    echo db2_status = 0
    **ENTER SYS COMMANDS HERE**
    goto :EOF
    :DB2_STATUS_NOT_0
    echo db2_status != 0
    **ENTER SYS COMMANDS HERE**
    goto :EOF
    :EOF
    del temp.sql
    del result.dat
    @echo onAs you can see, this is a simple if/then which takes the value from a dynamically created SQL file (temp.sql) and uses it do determine the next system commands to execute.
    Hope this is what ya needed.
    -Tim

  • How to exe OS command from sqlplus

    I used to exe OS command with ! in sqlplus in older version of Oracle. I just installed 10g Express and I tried !dir, and got the following error:
    SQL> !dir
    SP2-0042: unknown command "!dir" - rest of line ignored.
    Did I do something wrong?

    host seems to work in special cases
    On Microsoft Windows XP
    where dirme.bat contains
    dir
    host d:\path\to\dirme.bat
    results in output of dir
    whereas host dir
    results in an exception java.lang.ProcessImpl.create(Native Method)
    at oracle.dbtools.raptor.scriptrunner.commands.Host.handleEvent(Host.java:30)
    Works in Linux (for host ls)
    Could be a path/built in dos command problem.
    What is other peoples experience?
    -Turloch

  • A question about the SPOOL command in sqlplus

    Dear all,
    I have a question about the SPOOL Command and I would appreciate if you could kindly give me a hand. Consider the following sql script.
    SPOOL result.txt
    SELECT * FROM mytable;
    SPOOL OFF;This works pretty well, and the whole content of the table "mytable" is exported to the text file "result.txt". However, sqlplus prints also the number of lines
    printed after each query. As a result, after running this script, at the end of the file, I have always a line like
    "20541 lines returned"How can I avoid this line (the number of returned lines) in my result file?
    Thanks in advance,
    Dariyoosh

    Peter Gjelstrup wrote:
    Hi Dariyoosh,
    As you are about to find out, SQL*Plus is a really powerful tool once the wonders of it are discovered.
    You really should study the reference
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/toc.htm
    In your current case especially the SET command
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/ch_twelve040.htm#BACGAJIC
    Regards
    PeterHello there,
    Thank you very much for your attention to my problem and in particular the interesting links.
    Kind Regards,
    Dariyoosh

  • Select command on sqlplus

    Hello,
    We have our first Oracle database here, and I'm finding some problems to deal with sqlplus.
    When I start a select command to list the rows from a table which has 567 rows, I have a very big answer and I'm not able to see the first columns...
    I'd like to know how I can obtain the answer page by page...
    Is this possible ?
    Eduardo

    try:
    set pagesize 10This will give you a header every ten lines.
    Of course, you may ALSO have to do
    set linesize 120or something based on your screen size.
    and also, you may have to set each columns (that you are selecting like this
    col some_column_name format a10This will format it to 20 characters eventhough the column is defined as let's say varchar2(100).

  • "clear screen" command exits sqlplus

    Hi,
    I am running a 10gR2 database. when I issue "clear screen" command at the sqlplus prompt, it throws me out of the sqlplus. there are no error messages.
    anybody having the resolution ?
    thanks.

    I got it ... its a bug in 10.2.0.1, the version which I m using
    bug 4595395      CLEAR SCREEN causes SQLPLUS command line to dump
    this is resolved in 10.2.0.2 patchset. Note: 358749.1
    thanks.

  • Command Line sqlplus without using @filename

    How can I pass sql statement directly to sqlplus on command line without using an external file ?

    If the insert happens infrequently, then the cost of writing
    to a temporary file may not matter overall. And if the
    insert happens frequently, the cost of invoking SQL*Plus and
    connecting to the DB could outweigh the time for writing to
    a file.
    Do you have any problem doing something like:
    tail -f mylog.txt | myawkprog | sqlplus -s scott/tiger
    Here I'm thinking that 'myawkprog' prints appropriate INSERT
    and COMMIT statements.
    For what it is worth, I have an old, old Perl 4 script for a
    similar log parsing task. It keeps the SQL*Plus connection
    alive forever and makes sure there is no I/O buffering. The
    outline of it is below. Use at own risk.
    -- CJ
    #! /usr/local/bin/perl -w
    # Open I/O pipes
    open(LG, "tail -f /tmp/mylog.txt|") || die "Can't open input";
    open(SP, "| sqlplus -s scott/tiger") || die "Can't open sqlplus";
    # unbuffered I/O
    select(LG); $| = 1;
    select(SP); $| = 1;
    while(<LG>)
    chop;
    print SP "insert into mytab values ('$_');\n";
    print SP "commit;\n";
    # Never actually get here
    close(LG);
    close(SP);

  • HOST command in SQLPlus

    Hi everybody
    I have a script with two HOST commands inside one script. The problem is that the second host command is executed just before the first host command terminates. Is there a way to make the second waits till the first ends ?
    Thanks to all

    hi.
    I schedules my exports through crontab..
    I create a script for each schema export job and submit them to cron and it automatically runs the export as I scheduled them.

Maybe you are looking for

  • Outbound interface determination in file adapter?

    In my scenario files with different schemas can be send to XI from the same directory using the file adapter (so each file has a different interface that must be mapped etc.). I cannot add multiple interfaces to the file adapter in sender agreement a

  • How to config the logout time in BW

    If the user do'nt refresh the Bex report for a longtime  how to set the logout time in BW. Could someone give me some hits. Thanks.

  • How To:  Frame in a Transparent Document

    I'm not sure this is the place to ask a How To question.  If not, please pardon the space I am using. I want to create a frame (with a drop shadow) on a transparent canvas, and have the inside of the frame transparent as well.  I can create a New doc

  • Cannot make an automatic clearing with F.13

    Hi, I'm trying to make an automatic clearing using F.13, but there's a document that cannot be cleared - after performing the transaction, this document appears in the section "no clearing" inside Update run" Additional Log. On Update run" Error Log

  • Newbie question, need to get started!

    I haven't used Garageband before and can't seem to get past square one! I bought a First Act usb guitar cord to record guitar, when I plugged it in Garageband seemed to recognize it, and it looks like I'm getting a signal and can see the waves when I