Command line history buffer in sqlplus

hi,
this question is not XE specific, but I want to know, whether there is a command line history buffer in sqlplus. It is not very comfortable to to work with sqlplus, when you have to work on a text only vt100 terminal :(

no, not natively but it on linux you can use something like rlwrap which will do it for you

Similar Messages

  • How do I execute a returned sql string from a function on the command line?

    Hi,
    I have written a pl/sql function that will dynamically create a sql select statement. I need to be able to execute this statement from the command line. e.g from sqlplus
    Say my function is called "sql_create" and it returns "select * from customer"
    How do I execute the returned value from the command line?" Is it possible?
    SQL> select sql_create from dual;
    SQL_CREATE
    select * from customer
    SQL>
    So I try:
    SQL> exec execute immediate 'select sql_create from dual';
    SQL>
    I don't get an error but I don't get the result set either.
    Is there a command I can use instead of execute immediate?
    thanks,
    Susan
    Edited by: Susan123456 on Jul 2, 2009 1:21 AM

    depends on the frontend. Most frontends (like Java and .Net) know how to handle REF CURSORS. Instead of returing a "string" which represents a query, return a ref cursor
    SQL> ed
    Wrote file afiedt.buf
      1  create function sql_q return sys_refcursor
      2  is
      3     rc sys_refcursor;
      4  begin
      5     open rc for select * from emp;
      6     return rc;
      7* end;
    SQL> /
    Function created.
    SQL> var r refcursor
    SQL>
    SQL> exec :r := sql_q
    PL/SQL procedure successfully completed.
    SQL> print r
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        900                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1700        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1350        500         30
          7566 JONES      MANAGER         7839 02-APR-81       3075                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1350       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2950                    30
          7782 CLARK      MANAGER         7934 09-JUN-81       2551                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3100                    20
          7839 KING       PRESIDENT            17-NOV-81       5100                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1600          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1200                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81       1050                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3100                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1400                    10

  • Variable does not work for sqlplus (command line)

    Here is an select:
    variable x number;
    variable y number;
    variable a number;
    define x = 2000;
    define y = 2*1000;
    define a = &x+&y;
    select ener from adding where ener = &a;
    When I execute it under SQL*Plus Worksheet (client installed on my PC) then I get output:
    ENER
    4000
    1 row selected
    When I execute this same under command line sqlplus (under unix shell) then I get output
    old 1: select ener from adding where ener = &a
    new 1: select ener from adding where ener = 2000+2*1000
    no rows selected
    What is worng ?

    Nothing.
    Sqlplus is correct and sql worksheet is buggy.
    Define works with strings only. You cannot use it to calculate an expression.
    Apparently sql worksheet did calculate the expression, and sqlplus didn't, submitting it as a string.
    This is the expected behavior.
    This behavior can likely vary by version, so thank you for not providing version info.
    Will anything awful happen when you do, or is this just the lazyness epidemia in this forum?
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who did read documentation.

  • SQLPlus command line log

    Hi all,
    I am trying to find out how i can search the last # of prompt command line.....meaning what are the last # of command line issue at SQL>
    Does it have anythign to do with the autotrace?
    thanks

    Trying to get a history of the SQL>
    for example;
    SQL> 1
    SQL>2
    SQL>3
    SQL> Clear screen
    How can I get the previous SQL> line statement what was executed?
    Sorry, I am a newbie and still trying to figure out the lingo
    thanks

  • Can I Clear all history from command line?

    Is there a way to simulate clearing all history
    Tools -> Clear Recent History -> Everything
    from the command line in Windows 7?
    I'm writing test automation and this would come in handy when running my tests

    Hello
    "C:\Program Files\Mozilla Firefox\firefox.exe" -chrome "chrome://browser/content/preferences/sanitize.xul"
    UPDATE : '''the next is the correct :'''
    "C:\Program Files\Mozilla Firefox\firefox.exe" -chrome "chrome://browser/content/sanitize.xul"
    forget the first
    thank you

  • Specifying the container to connect to from command line utilities (sqlplus/expdp etc)

    Hi,
    To kick off this forum I've been playing around with 12c multitenant/pluggable features and I've a general question about connections to the container database - it seems from everything i tried so far (and everything I've read) that there is no way to connect to a container database without going through a sqlnet connection. For example:
    export ORACLE_HOME, ORACLE_SID etc
    sqlplus username/password -- this can only connect to the container database? (once you are in you can alter session to switch to the plugable database but can;t do it directly in the connection)
    to connect to a plugged in database you always have to go through sqlnet
    sqlpus username/password@pluggable
    there is no option to say something like:
    export ORACLE_SID=container
    export ORACLE_CONTAINER=pluggable
    and then do sqlplus username/password ?
    or some extra command line switch like
    export ORACLE_SID=container
    sqlplus -container=pluggable username/password
    Is that understanding correct or have i missed something in the documentation?
    Regards,
    Harry
    http://dbaharrison.blogspot.com

    Hello Richard,
    In Oracle Multitenant the only way to connect to a PDB is by specifying a service.
    However, there is a shortcut that you can use - TWO_TASK, which you will find documented elsewhere.
    This allows you to specify the default service to be used - think of it as being appended silently to your username/password specification. I hope this helps.
    Regards, Patrick

  • How to use sqlplus with utf8 on windows command line

    I expected sqlplus to work interactively with the following settings:
    - Lucida Console font for command window
    - chcp 65001 (UTF8-Windows-Codepage)
    - set NLS_LANG=.AL32UTF8
    But it turned out that
    1) sqlplus apparently does not use WIN32-API function ReadConsoleW and WriteConsoleW (these wide char functions must be used instead of ReadFile and WriteFile for Console I/O)
    2) cmd silently ignores all .cmd and .bat files with codepage set to 65001.
    I fear that such a problem regarding a minority of command line freaks has low priority for Oracle and for Microsoft, so I wrote two small filters in C.
    rconsu8 passes keyboard input to stdout, using ReadConsoleW
    wconsu8 passes stdin to console, using WriteConsoleW
    both set the UTF8-codepage 65001 and restore the previous codepage at exit.
    Anybody interested?
    (Yes, I know that I could use sqldeveloper.)
    Sample session:
    C:\>set NLS_LANG=.AL32UTF8
    C:\>rconsu8 | sqlplus scott/tiger@DBUTF8 | wconsu8
    SQL> select '€' from dual;
    '€'

    SQL> select * from test_cyrillic;
    NAME
    Йозеф
    Euro €

    Console Output
    works for characters covered by Lucida Console font if the first character in a line is ASCII (code < 128, e.g. blank)
    CHCP 65001
    sqlplus
    SQL> select ' ', unistr('Josef \0419\043E\0437\0435\0444') from dual;
    Josef Йозеф
    SQL> select ' ',unistr('Euro \20AC') from dual;
    Euro €
    Sven, windows is able to render the output (as covered by Lucida Console), but there is a quirk in MSVCRTxx (C Runtime-Lib), function fwrite(). The first byte in a line is passed separately to an isolated single write() call, which causes conversion of an utf8 sequence to fail.
    Console Input
    For non-ascii characters (code >= 128), ReadConsoleW must be called, e.g. through a simple filter converting UTF-16 stdin to UTF-8 stdout.

  • SQLplus TO_UPPER command line argument

    Hi,
    I am reading in a command line argument from SQLplus to use in a PL/SQL block, and need to do a TO_UPPER on the argument, but it doesn't work when I check against it,<br><b>
    IF UPPER('&1.') = 'IPF' THEN ...
    <br><br></b>
    How do I work around this? I tried declaring a variable and assigning the value to it, and then doing a TO_UPPER on it, but that didn't work either. How do I convert the command line argument to all uppercase in SQLplus?
    Thank you, Laura

    Laura:
    How are you calling the PL/SQL block? This works:
    SQL> !cat t.sql
    DECLARE
       l_v VARCHAR2(20);
    BEGIN
       IF UPPER('&1') = 'IPF' THEN
          l_v := 'Got IPF';
       ELSE
          l_v := 'Did not get IPF';
       END IF;
       DBMS_OUTPUT.Put_Line(l_v);
    END;
    SQL> @t abc
    old   4:    IF UPPER('&1') = 'IPF' THEN
    new   4:    IF UPPER('abc') = 'IPF' THEN
    Did not get IPF
    PL/SQL procedure successfully completed.
    SQL> @t ipf
    old   4:    IF UPPER('&1') = 'IPF' THEN
    new   4:    IF UPPER('ipf') = 'IPF' THEN
    Got IPF
    PL/SQL procedure successfully completed.John

  • SQLPLUS - redirection of output/command line

    I would like to send SQL-commands to Oracle 8.0.5 from a BATCH
    command line interface.
    I have by trial and error found the following to work in SQLPlus
    for Oracle 8.0.5
    SQLPLUS <userid>/<password>@<MACHINE> @<input.sql>
    However, this just starts a new window with the SQL-commands
    given in input.sql. I would like the output to be redirected to
    an output file - preferably without having to write long code in
    the input.sql file.
    Any hints or surgestions ?
    Yours
    Torben
    null

    Torben Lund (guest) wrote:
    : I would like to send SQL-commands to Oracle 8.0.5 from a BATCH
    : command line interface.
    : I have by trial and error found the following to work in
    SQLPlus
    : for Oracle 8.0.5
    : SQLPLUS <userid>/<password>@<MACHINE> @<input.sql>
    : However, this just starts a new window with the SQL-commands
    : given in input.sql. I would like the output to be redirected
    to
    : an output file - preferably without having to write long code
    in
    : the input.sql file.
    : Any hints or surgestions ?
    : Yours
    : Torben
    Hi Torben , if I understood your question you can put in your
    INPUT.SQL file de instruction SPOOL C:\TEMP\OUTPUTLIE.TXT
    before you execute the sql statements . At the end of results
    you have put the command SPOOL OFF . If after this you would
    like execute the file like a batch command file use the
    @c:\temp\outputfile.txt
    Ok ?
    Regards
    Lourival
    null

  • 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);

  • [solved] Limit to the pacman command line buffer?

    Is there such a thing as a limit to the number of characters in a pacman command line?
    It's easy enough to get past this with multiple calls to pacman but presents a problem with archiso where the apps are all listed in a single file that is used to call pacman only once. I might add that I'm using local repos in both instances below.
    The code below run as a single call to pacman...
    pacman -S \
    galculator \
    gnumeric \
    gimp \
    gksu \
    gnome-specimen-light \
    gnome-system-monitor
    ...produced the error below...
    error: target not found:
    galculator v2.1.2, (c) 2002-2013 Simon Flöry
    Usage: galculator [options]
    options:
    (GTK options)
    -h, --help Show this usage message
    -v, --version Show version information
    Compiled against GTK version 3.8.2
    Linked against GTK version 3.10.3
    Quad-precision floating point numbers.
    /tmp/xxx: line 7: gnome-specimen-light: command not found
    ...but running the script with multiple calls to pacman...
    pacman -S galculator
    pacman -S gnumeric
    pacman -S gimp
    pacman -S gksu
    pacman -S gnome-specimen-light
    pacman -S gnome-system-monitor
    ...everyting gets installed...
    warning: galculator-2.1.2-1 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    Packages (1): galculator-2.1.2-1
    Total Installed Size: 1.03 MiB
    Net Upgrade Size: 0.00 MiB
    :: Proceed with installation? [Y/n]
    (1/1) checking keys in keyring [##################################] 100%
    (1/1) checking package integrity [##################################] 100%
    (1/1) loading package files [##################################] 100%
    (1/1) checking for file conflicts [##################################] 100%
    (1/1) checking available disk space [##################################] 100%
    (1/1) reinstalling galculator [##################################] 100%
    warning: gnumeric-1.12.8-1 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    Packages (1): gnumeric-1.12.8-1
    Total Installed Size: 32.30 MiB
    Net Upgrade Size: 0.00 MiB
    :: Proceed with installation? [Y/n]
    (1/1) checking keys in keyring [##################################] 100%
    (1/1) checking package integrity [##################################] 100%
    (1/1) loading package files [##################################] 100%
    (1/1) checking for file conflicts [##################################] 100%
    (1/1) checking available disk space [##################################] 100%
    (1/1) reinstalling gnumeric [##################################] 100%
    warning: gimp-2.8.8-1 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    Packages (1): gimp-2.8.8-1
    Total Installed Size: 64.69 MiB
    Net Upgrade Size: 0.00 MiB
    :: Proceed with installation? [Y/n]
    (1/1) checking keys in keyring [##################################] 100%
    (1/1) checking package integrity [##################################] 100%
    (1/1) loading package files [##################################] 100%
    (1/1) checking for file conflicts [##################################] 100%
    (1/1) checking available disk space [##################################] 100%
    (1/1) reinstalling gimp [##################################] 100%
    warning: gksu-2.0.2-4 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    Packages (1): gksu-2.0.2-4
    Total Installed Size: 0.05 MiB
    Net Upgrade Size: 0.00 MiB
    :: Proceed with installation? [Y/n]
    (1/1) checking keys in keyring [##################################] 100%
    (1/1) checking package integrity [##################################] 100%
    (1/1) loading package files [##################################] 100%
    (1/1) checking for file conflicts [##################################] 100%
    (1/1) checking available disk space [##################################] 100%
    (1/1) reinstalling gksu [##################################] 100%
    warning: gnome-specimen-light-0.4-2 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    Packages (1): gnome-specimen-light-0.4-2
    Total Installed Size: 0.20 MiB
    Net Upgrade Size: 0.00 MiB
    :: Proceed with installation? [Y/n]
    (1/1) checking keys in keyring [##################################] 100%
    (1/1) checking package integrity [##################################] 100%
    (1/1) loading package files [##################################] 100%
    (1/1) checking for file conflicts [##################################] 100%
    (1/1) checking available disk space [##################################] 100%
    (1/1) reinstalling gnome-specimen-light [##################################] 100%
    warning: gnome-system-monitor-3.10.1-1 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    Packages (1): gnome-system-monitor-3.10.1-1
    Total Installed Size: 4.53 MiB
    Net Upgrade Size: 0.00 MiB
    :: Proceed with installation? [Y/n]
    (1/1) checking keys in keyring [##################################] 100%
    (1/1) checking package integrity [##################################] 100%
    (1/1) loading package files [##################################] 100%
    (1/1) checking for file conflicts [##################################] 100%
    (1/1) checking available disk space [##################################] 100%
    (1/1) reinstalling gnome-system-monitor [##################################] 100%
    Last edited by KairiTech (2013-11-17 17:12:40)

    There is likely a limit, but that's not what the problem is here. Highlight the text in the codeblock:
    KairiTech wrote:pacman -S \
    galculator \
    gnumeric \
    gimp \
    gksu \
    gnome-specimen-light \
    gnome-system-monitor
    You are including spaces after the backslashes on multiple lines, so you are not escaping the newlines but only the spaces. The first line simply calls pacman with a space, which is why you get "target not found" (there is no package named " ") instead of "no targets specified".
    The next line invokes galculator with gnumeric, gimp and " " as arguments, etc.
    Incidentally, if you need to deal with long package lists, you can pipe them via other commands or from files, e.g.
    pacman -S - < /path/to/file/list
    cmd_that_prints_long_list | pacman -S -

  • How to run stored procedure in DOS command line????

    Hi,
    I want to run a stored procedure in DOS command line?
    (My_Stored_Procedure is the stored procedure that I want to run )
    This is what I did in DOS prompt
    C:\>sqlplus scott/tiger exec lMy_Stored_Procedure <Return>
    Obviously it is NOT working. Please send me the correct way to fix this.
    Thanks so much in advance for helping.
    Cuong

    Billy  Verreynne  wrote:
    BluShadow wrote:
    True Billy, but even Windows hasn't completely got away from using the "DOS" word...Yeah - the command line/shell environment is based on that of the old DOS command interpreter. But Microsoft does not make the mistake of call it DOS.
    In fact, with earlier versions of Windows NT, a 16bit DOS real-mode virtual machine was supported. This was very kewl.
    Running a large BBS with multiple nodes back then required a DOS machine per node, an IPX network, and a Novell file server.Novell Netwars. ;)
    Ahhhh! good old DOS... so many good programs written at that low level, outside the Windoze environment.Yeah.. cut my teeth on writing code for DOS. Still have all my old BIOS and assembler manuals for it. Wrote my own screen s/w (write to a buffer and then move it into the video buffer, instead of writing char wise to the video buffer via interrupts), mucking about with my own concurrent threading model (using very simplistic cooperative multitasking) and so on. Heck, wrote tons of s/w on DOS... :-)Yeah I've still got a copy of my old machine code programs for writing to buffers and screen memory switching for smooth animation. Run them nowadays and they run like sh!t off a shovel. And all my old coursework including writing an interpreted language and multi-window (dos based windows) editor, parser and the code to execute the language and display the output. Oooo, and so much other stuff.
    Awesome back then as you got really intimate with the o/s and hardware. This is sorely lacking today in environments like Java. And I think the reason why so much code written today is less than optimal - to put it kindly.Exactly. Started for me on the Sinclair zx81 (writing Basic), then the Sinclair Spectrum (Basic and Assembly), then Sinclair QL (yes I really had one!) and then the BBC Master 128K (where I got to writing my own rom filing system and creating my own eproms, to integrate with the word processor for additional printing features etc. as well as storing games on rom for speedy loading - and I still have it and it still works!)
    It's that level of working with the underlying memory and assembly language that gives you the understanding of how values are passed between code using the stack and registers, and how memory allocation and referencing is done etc. As you say... it's missed in a lot of todays teaching, which just seems too high level and misses the basic concepts of things such as datatypes and why they are different. I bet half the modern programmers wouldn't have a clue how to do multiplication or division of binary numbers using the carry flag.

  • Using java to run command line as %username%

    Hi all,
    can any one help with this?
    I'm trying to run a command line from a database as %username% in Windows. So far I have the following script, courtesy of Frank Naude to build a java class that is published within a plsql procedure. A command line can then be passed to it.
    rem -----------------------------------------------------------------------
    rem Filename: oscmd.sql
    rem Purpose: Execute operating system commands from PL/SQL
    rem Notes: Specify full paths to commands, for example,
    rem specify /usr/bin/ps instead of ps.
    rem Date: 09-Apr-2005
    rem Author: Frank Naude, Oracle FAQ
    rem -----------------------------------------------------------------------
    rem -----------------------------------------------------------------------
    rem Grant Java Access to user USER1
    rem -----------------------------------------------------------------------
    conn sys/password@database as sysdba
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.io.FilePermission', '/bin/sh', 'execute');
    EXEC dbms_java.grant_permission( 'USER1', 'SYS:java.io.FilePermission','C:\WINDOWS\system32\cmd.exe', 'execute' );
    rem -----------------------------------------------------------------------
    rem Create Java class to execute OS commands...
    rem -----------------------------------------------------------------------
    conn user1/password@database
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\WINDOWS\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    // Execute the command...
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    // Capture output from STDOUT...
    BufferedReader br_in = null;
    try {
    br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("stdout: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_in.close();
    } catch (IOException ioe) {
    System.out.println("Error printing process output.");
    ioe.printStackTrace();
    } finally {
    try {
    br_in.close();
    } catch (Exception ex) {}
    // Capture output from STDERR...
    BufferedReader br_err = null;
    try {
    br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("stderr: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_err.close();
    } catch (IOException ioe) {
    System.out.println("Error printing execution errors.");
    ioe.printStackTrace();
    } finally {
    try {
    br_err.close();
    } catch (Exception ex) {}
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    show errors
    rem -----------------------------------------------------------------------
    rem Publish the Java call to PL/SQL...
    rem -----------------------------------------------------------------------
    CREATE OR REPLACE PROCEDURE host(p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    show errors
    rem -----------------------------------------------------------------------
    rem Let's test it
    rem -----------------------------------------------------------------------
    exec host('notepad');
    The trouble is although this script works great for commands that can be run is the 'background' as SYSTEM is I want to pass a command to actually open something e.g. notepad in the above example nothing seems to happen. As far as I can make out the command line is running but not as %username% so it's not running notepad.exe in the foreground.
    I'm happy to clarify more if necessary.
    Can anyone help with this?
    Cheers
    Yog

    Bill,
    Thank you for the quick answer. I believe you are right in your assumption.
    I have been searching but found nothing so far.
    I need to be able to run this line "wmic
    Product where name='XXX XXX XXX' call uninstall" 
    in an elevated command prompt to uninstall the program.
    I was looking for a VB script or PowerShell to execute it remotely on non domain roaming PCs.
    Th3e command can be run remotely against stand-alone workstations but you must supply credentials.  Post in the platform forum for you version of Windows for help in using the WMIC utility.  WMIC /? will give you all of the command options fro
    remote execution.  UAC only affects local systems.  You cannot use WMIC to remote back to the local system. WMIC does not allow impersonation to the local system.
    Most installers will not automatically allow an unattended uninstall.  If there is any dialog at all the uninstall will fail and can hang.
    I recommend contacting the vendor of the application to get more information.
    In all cases you cannot bypass UAC as Bill has noted.  I am only noting that, sometimes, in a workgroup, you can use WMIC to remotely uninstall an application.
    ¯\_(ツ)_/¯

  • Problems Creating a CSV from command line

    I have tried to create a csv file from the command line and get some unwanted lines of data in the output. Does anyone know how to create a csv without the extra lines from the command line.
    I am using the following sequence of commands.
    set wrap off
    set termout off
    set verify off
    set heading off
    set feedback off
    set lines 900
    set pages 9999
    set newpage none
    set embedded on
    set colsep ','
    set trimspool on
    spool test6.lst
    select * from rft;
    spool off
    When I run this from a script, I get exactly the data, which is what I want.
    When I run this from the command prompt, I get an extra line at the start and one at the end of the csv file.
    The data at the start is like this:
    WMSP:wmsp:SQL*Plus> select * from rft;
    The data at the end is like this:
    WMSP:wmsp:SQL*Plus> spool off
    Does anyone know how to keep these lines out of the data?
    Thank you.

    >
    The data at the start is like this:
    WMSP:wmsp:SQL*Plus> select * from rft;
    The data at the end is like this:
    WMSP:wmsp:SQL*Plus> spool off
    Does anyone know how to keep these lines out of the
    data?
    Well, a workaround could be to use one of the gazillions of utilities in Unix/Linux to remove all lines having the sql prompt (SQL>), right after your "test6.lst" file has been created.
    I am using the "perl pie" for the same in the code snippet that follows:
    $
    $ cat create_csv.sh
    #!/bin/bash
    sqlplus -s test/test << EOF
    set wrap off
    set termout off
    set verify off
    set heading off
    set feedback off
    set lines 900
    set pages 9999
    set newpage none
    set embedded on
    set colsep ','
    set trimspool on
    set echo off
    spool test6.lst
    select * from t;
    spool off
    EOF
    # remove the lines that have the sql prompt: SQL>
    perl -pi -e "s/SQL\>.*$|^$\n//g" test6.lst
    $
    $ # run the script, dump stdout to the null device
    $ create_csv.sh 1>/dev/null
    $
    $ cat test6.lst
             1,a
             2,b
             3,c
             4,d
    $
    $Note that the "test6.lst" on my system had the prompt "SQL>". You will have to tweak that regular expression so that it works for the prompt in your "test6.lst" file.
    pratz

  • Running FlexUnit tests from command line

    Sorry if that has been posted before: I searched best I could and nothing came up.
    I am interested in building and running my unit tests from the command line so we can add it to a nightly build process.
    I am *very* new to all this: basically I picked up Adobe Flash Builder 4 a month ago and I have done *everything* inside that IDE: writing code, building, testing, running.
    I looked into at least how to build something from the command line, I found this:
    http://help.adobe.com/en_US/flashbuilder/using/WSbde04e3d3e6474c4-59108b2e1215eb9d5e4-8000 .html
    Can't get past this error:
    Buildfile: /Users/dbanks/build_test.xml
    BUILD FAILED
    Target "FlexUnitApplication" does not exist in the project "null".
    Total time: 0 seconds
    Adobe Flash Builder 4:
    An error has occurred. See the log file
    /Users/dbanks/Documents/Adobe Flash Builder 4/.metadata/.log.
    Plus, even if I got this going, I am just building the swf.  I also want to run it and capture the output in some meaningful way that can be read/evaluated/acted on.
    FWIW, the script/xml I am using to try to build:
    build_test.xml:
    <?xml version="1.0"?>
    <project default="main">
        <target name="main">
            <fb.exportReleaseBuild project="NightclubMogul" />
        </target>
    </project>
    execute_build_test.sh:
    WORKSPACE="$HOME/Documents/AdobeFlashBuilder4"
    # works with either FlashBuilder.app or Eclipse.app
    "/Applications/AdobeFlashBuilder4" \
        --launcher.suppressErrors   \
        -noSplash   \
        -application org.eclipse.ant.core.antRunner   \
        -data "$WORKSPACE"    \
        -file "/Users/dbanks/build_test.xml" FlexUnitApplication
    I am not clear what in here is actually supposed to point to where my project lives: it's off in some directory somewhere.  I see that I am pointing to a workspace (Documents/AdobeFlashBuilder4) but when I poke around in there I don't see anything connecting back to the directories where the code lives.
    Any help would be great: getting the tests to build from command line, then getting them to run.

    C:\>sqlplus @myscript
    That would be the easiest variation
    C:\>sqlplus user/passwd@tns_alias @myscript
    would be an often used variation
    And then there is of course the version with parameter passing:
    C:\>sqlplus user/passwd@tns_alias @myscript param1 ... paramx
    Dunno about MSBuild

Maybe you are looking for

  • AS2 Adapter issues

    Hi, I have a scenario (Proxy to AS2). Receiver channel is configured to HTTPS. It passes successfully through MONI, but gives error in Receiver adapter. Exact error is : "Message processing failed. Cause: javax.resource.ResourceException: Fatal excep

  • Programming a c application which is calling a *.so built by LabVIEW.

    Hello all, This question probably has been asked, but I can't find the answer.  So here's my question: I have built a LabVIEW *.so in Linux and I want to call it from a "c" application.  The LabVIEW *.so is returning a cluster of strings and I want t

  • Where in SAP ECC 6.0, I  can Maintain the Constant CADTR  for COA/CLA

    Hi All, Where in SAP ECC 6.0, I  can Maintain the Constant CADTR treatment for COA/CLA Housing Perkrs. I am facing problem in calculation of housing Perk Calculation in SALARY PROCESSING. Please Suggest. THANKS in advance. Dilip Parab

  • In the "Numbers" app can you paste "as values" as you can in excel?

    In the "Numbers" app can you paste "as values" as you can in excel?

  • How to use the Occupancy grid block

    Hi everybody, I was looking for related examples in labview with any sensor and the Occupancy grid Map block, but, I couldn't find anything, only some simulations. I would like to know if somebody have tried to use it with the data from a sensor in o