Possible to execute 2 commands in 1 line?

Hi,
is it possible to concatenate 2 commands, i.e. "desc dba_tables" and "select count(1) from dba_tables" in one line and execute them? ...
SQL> desc dba_tables && select count(1)...
or something like that?
I don´t want a script!
THX in advance...
Paul

SQL> desc dba_tables && select count(1)...
is not possible, but you could try
select column_name "Name", decode(nullable,'N','NOT NULL') "Null?", substr(decode(data_type,'VARCHAR2','VARCHAR2('||DATA_LENGTH||')',
'CHAR','CHAR('||DATA_LENGTH||')',
'NUMBER','NUMBER'||decode(DATA_PRECISION,null,null,'('||data_precision||decode(data_scale,0,null,','||data_scale)||')'),
data_type),1,20) "Type"
from dba_tab_columns
where table_name = 'DBA_TABLES'
union all select to_char(null),to_char(null),to_char(null) from dual
union all select '  COUNT(*)',to_char(null),to_char(null) from dual
union all select '----------',to_char(null),to_char(null) from dual
union all select to_char(count(*)),to_char(null),to_char(null) from dba_tables;
Name                                     Null?    Type
PCT_INCREASE                                      NUMBER
FREELISTS                                         NUMBER
FREELIST_GROUPS                                   NUMBER
LOGGING                                           VARCHAR2(3)
BACKED_UP                                         VARCHAR2(1)
NUM_ROWS                                          NUMBER
BLOCKS                                            NUMBER
EMPTY_BLOCKS                                      NUMBER
AVG_SPACE                                         NUMBER
CHAIN_CNT                                         NUMBER
AVG_ROW_LEN                                       NUMBER
AVG_SPACE_FREELIST_BLOCKS                         NUMBER
NUM_FREELIST_BLOCKS                               NUMBER
DEGREE                                            VARCHAR2(10)
INSTANCES                                         VARCHAR2(10)
CACHE                                             VARCHAR2(5)
TABLE_LOCK                                        VARCHAR2(8)
SAMPLE_SIZE                                       NUMBER
LAST_ANALYZED                                     DATE
PARTITIONED                                       VARCHAR2(3)
IOT_TYPE                                          VARCHAR2(12)
TEMPORARY                                         VARCHAR2(1)
SECONDARY                                         VARCHAR2(1)
NESTED                                            VARCHAR2(3)
BUFFER_POOL                                       VARCHAR2(7)
ROW_MOVEMENT                                      VARCHAR2(8)
GLOBAL_STATS                                      VARCHAR2(3)
USER_STATS                                        VARCHAR2(3)
DURATION                                          VARCHAR2(15)
SKIP_CORRUPT                                      VARCHAR2(8)
MONITORING                                        VARCHAR2(3)
CLUSTER_OWNER                                     VARCHAR2(30)
DEPENDENCIES                                      VARCHAR2(8)
COMPRESSION                                       VARCHAR2(8)
DROPPED                                           VARCHAR2(3)
OWNER                                    NOT NULL VARCHAR2(30)
TABLE_NAME                               NOT NULL VARCHAR2(30)
TABLESPACE_NAME                                   VARCHAR2(30)
CLUSTER_NAME                                      VARCHAR2(30)
IOT_NAME                                          VARCHAR2(30)
PCT_FREE                                          NUMBER
PCT_USED                                          NUMBER
INI_TRANS                                         NUMBER
MAX_TRANS                                         NUMBER
INITIAL_EXTENT                                    NUMBER
NEXT_EXTENT                                       NUMBER
MIN_EXTENTS                                       NUMBER
MAX_EXTENTS                                       NUMBER
  COUNT(*)
930

Similar Messages

  • Is it possible to execute OS commands/files on remote server using SOA Suite/BPEL , just like we have JCA adapter File/FTP to exchange files across servers ?

    I am working on technical process automation requirement wherein files need to be exchanged and executed as well , SOA workflow capabilities are helping but I could not find a way to remote OS comman execution yet.
    Please help.
    Thanks

    The whole idea of SOA is to run web services located anywhere. So I believe if you can expose the runtime in remote servers as services then you will be able to call those services like any other web service.
    Or if you requirement is to execute files on the SOA server itself then you can use the java embedding activity.

  • Execute SQLPLUS command using JDBC

    Hi,
    I was wondering if its possible to execute sqlplus command (eg set define off, change date format ..etc) using JDBC ?
    Can anyone please post me some sample codes about this ?
    Any help will be appreciated

    Hi,
    But the Runtime.exec() and the JDBC application have
    their own connection to the database, and the sqlplus
    commands that i need to run are session based (only
    valid during the connection). eg set define off
    How do I overcome this ?
    Huh?
    You put anything you want into a input file. You feed the input file to sqlplus. If there are results then you put them into an output file.
    None of that has anything to do with JDBC nor even with java. When you call Runtime.exec() you are running a completely different process. What you do with that process is up to you.

  • Execute dir command and get output

    Hi,
    Is it possible to execute a command such as dir,md or copy using a java prorgam.Plz tell me how to do this.
    Thanks a lot,
    Chamal.

    You can get that dir info from java.io.File.listFiles(), of course.
    But if you just want to run OS commands you can do it with java.lang.Runtime:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    MOD

  • Execute panel commands

    Hello everybody,
    is it possible to execute panel commands like Swatches->Add Selected Colors from a Plugin?
    If not, has anybody an idea how I could implement this command?
    Thanks for any answer!

    Hi,
    I just tried the same configuration and it works properly. Since you're not using any end of string character, any read operation will return after the specified timeout with the data in the buffer. I don't know what could be happening, but I can give you some testing ideas.
    It seems that you are already doing a loopback test. Try doing the test using hyperterminal. Here's a document that describes the process:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/D48BA43C59B60277862569EE000501FD?opendocument&node=DZ52363_US
    Using hyperterminal will show if there's any hardware or connection problems.
    If not already doing it, do a loop backtest with the sample program or the Test panel of the ActiveX control.
    Hope this helps.
    DiegoF.

  • Executing client commands without using webutil

    Hi,
    Overview: Our dba is busy enough to be disturbed for configuring webutil for me to execute client commands like client_host, client_text_io, etc.
    The forms resides on unix server, then I want to implement a feature that writes data to a file then to be saved in the client's
    local directory.
    Question: I was just wondering if I can or is it possible to execute client commands specifically windows commands without using client_host?
    Any help would be much appreciated.

    I think i found a way on how to do it, using Runtime.getRuntime().exec

  • Execute powershell commands on a VM from the host.

    I’m wondering if it’s possible to execute PowerShell commands from the host that will be execute on a virtual machine.
    I have around 10 VM and I need to run the same command on all of it and I need to do the same in other 15 host.  
    None of the VM belong to the same domain.

    Yes, it's possible. 
    It's not recommended to do any administrative tasks from the host. You should remove the GUI and all roles from the host except things related to Hyper-V and used in your environment like Failover Clustering and MPIO. 
    As a best practice, set a Windows 8.1 VM as your management station and install RSAT tools on it including Hyper-V Manager. It also comes with Powershell modules you need to run Powershell commands and scripts against all your hosts and VMs.
    On the machines to be managed by Powershell you need to enable Powershell Remoting. In Server 2012 and above and Windows 8 and above this is enabled out of the box (even core versions). In older versions of Windows
    enable Powershell Remoting manually as shown in this post.
    On the management Win 8.1 VM that has RSAT installed, if the managed machines belong to the same domain as the managing station, you're good to go. If not, run this command on the managing station:
    winrm s winrm/config/client "@{TrustedHosts=""My2003Server,host2,host3,vm4""}"
    Execute your scripts against multiple machines by using Invoke-Command as in:
    'Computer1','Computer2','Computer3' | % {
    $Result = Invoke-Command -Computer $_ -ScriptBlock {
    Get-Process
    $Result
    This example, will execute the commands in the scriptblock on each of the 3 computers in line1, and return the result.
    For more information see
    Don Jones' Secrets of Powershell Remoting eBook.
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • How to execute unix command line from cocoa?

    how to execute unix command line from cocoa?
    for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
    thank you.
    Power G5 Quad Mac OS X (10.4.3)

    The following article may also help:
    http://cocoadevcentral.com/articles/000025.php
    Mihalis.
    Dual G5 @ 2GHz   Mac OS X (10.4.6)  

  • How to run an executable from command-line

    I'm learning how to use the Terminal and I got stuck in a silly thing (I suppose it is). How can I run an executable file from command-line in Terminal?
    For example: I have a file named "Hello" in the folder /sample. If I use the ls command (ls sample), I can see the file Hello. Then I move to the directory (cd /sample) and try to run the file Hello (typing "Hello") but I got "command not found" message.
    If I drag the Hello file from Finder to Terminal and hit Return, it runs perfectly. And if I type the full path to the file (even if I'm already inside its directory), it also runs.
    So, my doubt is if there is any command to run an executable from command-line.
    Thanks

    KJK555 wrote:
    Hi VK:
    Can you enlighten me on why it's neccessary to do the "./" thingy in OS X when in unix/linux
    I never had to resort to doing that?
    Kj
    I took the trouble of reading *man bash* and it explains the issue. to add the current directory to PATH you need to add an empty path to PATH like this
    PATH=$PATH::
    you can add it to ~/.bash_profile so that it's executed automatically when you start bash. I suspect the linux system you are talking about had this set up by default or had it added to PATH in /etc/profile which defines PATH globally.

  • Is it possible to execute OS level commands through Oracle APEX?

    Hi,
    I would like to know if it is possible to execute OS level commands, say executing any command in command prompt using Oracle APEX.
    Thanks!

    Welcome to Oracle Forums!
    Please acquaint yourself with the FAQ and forum etiquette if you haven't already done so.
    Always state
    <ul>
    <li>Apex Version</li>
    <li>DB Version and edition</li>
    <li>Web server used.I.e. EPG, OHS, ApexListner Standalone or with J2EE container</li>
    <li>When asking about forms always state tabular form if it is a tabular form</li>
    <li>When asking about reports always state Classic / IR</li>
    <li>Always post code snippets enclosed in a pair of &#123;code&#125; tags as explained in FAQ</li>
    </ul>
    I would like to know if it is possible to execute OS level commands, say executing any command in command prompt using Oracle APEX.If by OS you are referring to the client side, then NO.
    Cheers,

  • How to include a parameter executing a command line from java??

    Hey
    I've a problem It's very single for you: this consists in execute a command from java
    in this case the command is : runas but I've tried nd is good but I can´t include the password.
    This is due to the sintaxis is :
    runas /user:127.0.0.1\Administrator cmd
    The first command is execute but.. the problem is it show the input for the password.
    And the password is not let including in the command line
    How can I do that? Please help me is very urgent.
    Any help will be very appreciated.
    Thanks in advance.
    Best Regards.

    DAnt. wrote:
    what is the name of the correct forum which I must visite? this is because I couln't found the correct forum.You will not find it on the Oracle website
    I expect your prompt reply,help me!http://tinyurl.com/yak89nc

  • Execute Process Task :Executing DOS Command lines in Execute Process Task

    Hi All,
    I am trying to sftp files using Tectia Client from my local system. For that I have used the Execute Process Task in SSIS. First I open DOS command and try to instantiate the sftp3.exe.
    Then I write down the below command
    binary
    open username@hostname
    lcd C:\Test
    cd <Destination Path name>
    put test.txt
    How to execute the command in execute process task ?
    help is appreciated
    Thanks

    Hi ConnectDebz,
    According to your description and script example, do you use WinSCP.exe to perform the SFTP files transfer? If so, you should set the Executable of the Execute Process Task to the path of the WinSCP.exe, save the script in a .txt file and set the Argument
    of the Execute Process Task like “/script=C:\Temp\sftploader.txt” (without quotes).
    References:
    http://www.sqlservergeeks.com/blogs/raunak.jhawar/sql-server-bi/395/sql-server-sftp-with-ssis-execute-process-task 
    http://gregcaporale.wordpress.com/2012/02/23/using-sftp-in-sql-server-ssis/ 
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Unable to execute a command line command using Java

    I am trying to run a command to add a group name. It is executed in command prompt of Windows 2003/2000
    Say this is the command I want to execute:
    net localgroup LordSM /add
    Here LordSM is the group name.
    I wrote the following code but it does not seem to work. Please suggest.
    String ABC=Value1TextField.getText();
    Value2Label.setText("Value is now " + ABC);
    // Above is to get value from a JText Field
    // Below is the code to run command for adding a group name to a System.
    String ExecutedCmd = "net localgroup " + ABC + "/add";
    Process p = Runtime.getRuntime().exec(ExecutedCmd);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null)
    { System.out.println(s); }
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null)
    { System.out.println(s); }
    I am trying to run a command to add a group name. It is executed in command prompt of Windows 2003/2000
    Say this is the command I want to execute:
    net localgroup LordSM /add
    Here LordSM is the group name.
    I wrote the following code but it does not seem to work. Please suggest.
    String ABC=Value1TextField.getText();
    Value2Label.setText("Value is now " + ABC);
    // Above is to get value from a JText Field
    // Below is the code to run command for adding a group name to a System.
    String ExecutedCmd = "net localgroup " + ABC + "/add";
    Process p = Runtime.getRuntime().exec(ExecutedCmd);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null)
    { System.out.println(s); }
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null)
    { System.out.println(s); }
    It does not seem to work means, that no Standard Error is defined, when it executes and group name is not added as well. The following is JUnit Test Result: Hope it gives a better idea of the problem I am facing:
    compile:
    run:
    Here is the standard output of the command:
    Here is the standard error of the command (if any):
    The syntax of this command is:
    NET LOCALGROUP [groupname [/COMMENT:"text"]] [DOMAIN]
    groupname {ADD [/COMMENT:"text"] | /DELETE} [DOMAIN]
    groupname name [...] {ADD | /DELETE} [DOMAIN]
    Got it
    BUILD SUCCESSFUL (total time: 10 minutes 49 seconds)
    I had even tried this:
    Runtime rt =Runtime.getRuntime();
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe";
    cmd[1]="net localgroup";
    cmd[2] =ABC + "/add";
    rt.exec(cmd);
    but again, it does not give any error as such, but it does not create the group name either. Please suggest. We can see the group names that are added on right clicking My Computer Icon and click Manage and then go to User & Group section. On executing either of the code nothing happens.
    Thanks

    Duplicate post:
    http://forum.java.sun.com/thread.jspa?threadID=5203526&messageID=9812067#9812067

  • How to execute sqlplus command in bat file ?

    Hello
    I have a simple script file that looks like this:
    "sqlplus admin/admin as sysdba
    shutdown immediate"
    But.. when i start this file.bat my system logs but do not make any script. Sqlplus just waiting for command, and when i write "exit" i logout from sqlplus, and then system execute next command, that is "shutdown immediate" but beyond sqlplus (so my base is still working). Is it at all possible to log on and execute commands from file.bat or some other way ?
    I'm using oracle 11g, windows 7x64
    Regards and thx for help
    Edited by: 879529 on 2011-11-27 04:52

    969970 wrote:
    Thank you that worked for me.But I fear you don't really understand WHY it worked, and WHY your first attempts did not work.
    So let me explain
    Given this .bat file
    sqlplus / as sysdba
    shutdown immediateWhat happens when you execute the file? The windows command processor reads the file line by line and processes the command on each line. What is the first lilne?
    sqlplus / as sysdbaSo what would you expect to happen when Windows processes that line? Remember, it's exactly as if you had entered that command yourself at the command prompt .... Answer: The OS locates an executable file named 'sqlplus', loads it into memory and passes control to it, along with a pointer to the rest of the command line ('/ as sysdba'). At that point, the executable sqlplus has control and will do whatever it wants with the command line it was passed ('/ as sysdba') and then waits for user input for more commands, including an 'exit' command. Where are those commands going to come from? They are NOT going to come from the next line in the bat file. They can't. The command processor that is running the bat file is still waiting for sqlplus to finish and return control. So you are stuck. The only way out is to break out of sqlplus with a 'ctl-break'. Once that happens, the command processor moves on to the next line in the bat file:
    shutdown immediateSo now the os tries to locate an executable file named 'shutdown' .... you probably don't have an executable by that name (let's hope not!) so you then get an error message from the OS informing you that
    'shutdown' is not recognized as an internal or external command,
    operable program or batch file.Now, if you were using a real OS, you could achieve what you wanted by using input redirection, but unfortunately, Windows just has a toy for a command processor.

  • Trying to find a way to execute from command prompt using java....

    I want to find a way to execute a command from the command line using a java program this is my code:
    import java.io.*;
    public class SQLHopefully
         public static void main(String[] args)
              try{
              Runtime rt = Runtime.getRuntime();
              Process proc = rt.exec("cmd /k start cmd.exe");
              OutputStream out = proc.getOutputStream();
              System.out.println(out);
              out.write("test.txt".getBytes()); //I THOUGHT THIS WOULD WORK
              InputStream stdin = proc.getErrorStream();
              InputStreamReader isr = new InputStreamReader(stdin);
              BufferedReader br = new BufferedReader(isr);
              String line = null;
              while ( (line = br.readLine()) != null) {
              System.out.println(line);
              stdin = proc.getInputStream();
              isr = new InputStreamReader(stdin);
              br = new BufferedReader(isr);
              line = null;
              while ( (line = br.readLine()) != null) {
              System.out.println(line);
              int exitVal;
              try {
              exitVal = proc.waitFor();
              } catch (InterruptedException e) {
              throw new IOException(e.getMessage());
              if (exitVal != 0) {
              throw new IOException("Exit value was " + exitVal ");
              }catch(IOException e)
              {System.out.println("ummmmm");}
    I hope my code is readable. I am trying to get the command prompt that comes up from the Runtime.exec() to run a file called "test.txt" I know it would be easier to just do it by executing it from java but I want to see if it is possible this way. I thought the out.write would do the trick but I was wrong. Somebody help please....
    Nate

    First read this article:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Second, you should probably send the Enter key to the shell if you want anything to happen. (Not that I know whether it will work, but I do know it won't work if you don't press Enter.)

Maybe you are looking for

  • Windows XP SP3 for my mac book pro

    I want to know if i can install windows XP SP3 on my mac book pro ( new one from yesterday) version 10.6.7 ?

  • Error to import  RFC (ABAP) service in CAF

    I am trying to import a ABAP service  (as an external service) BAPI_USER_GET_DETAIL and getting the following error after selecting  BAPI_USER_GET_DETAIL  checkbox cannot load R/3 descriptions. Env. - NetweSAP NetWeaver Developer Studio Version: 7.0.

  • Streaming music from iPod to stereo

    Does Linksys/Cisco make a device that will connect my iPhone to my stereo via wifi? I am looking to stream audio from my iPhone via wifi connection to a music bridge that will connect directly into the RCA jacks or headphone input of my stereo. It lo

  • How do I get copies of my Apple equipment purchases for 2012?

    For tax purposes, I would like copies of my hardwarde and software purchases during 2012. How does one go about getting this information?

  • New macbook pro 15 screen issue (blue-ish)

    hi just got a brand new mbp from apple store...got it friday everything is great but the screen is slightly on the blue tint side i tried the calibration but it only makes it worse i also downloaded all the updates from apple i'm going to an apple st