DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How to use results from sqlplus host command

  1. #1
    Join Date
    Mar 2001
    Posts
    46

    Question

    Hi All,
    Is it possible to place the results of sqlplus host command into a variable ? Or even into an array of variables?

    Here are 3 examples:

    1 item returned: host pwd

    1 row, multiple items: host uptime

    multiple rows: host ls

    How can I use the return values in sqlplus?

    TIA!
    ora_newbie@yahoo.com

  2. #2
    Join Date
    Sep 2000
    Location
    Sao Paulo,SP,Brazil, Earth, Milky Way
    Posts
    350
    One way : ask for HOST pwd > resultfile.txt , and later run a PL/SQL routine to read resultfile.txt via UTL_FILE.

    Regards,

    Chiappa

  3. #3
    Join Date
    Sep 2001
    Posts
    1
    Originally posted by PFC
    Hi All,
    Is it possible to place the results of sqlplus host command into a variable ? Or even into an array of variables?

    Here are 3 examples:

    1 item returned: host pwd

    1 row, multiple items: host uptime

    multiple rows: host ls

    How can I use the return values in sqlplus?

    TIA!

  4. #4
    Join Date
    Apr 2001
    Location
    Louisville KY
    Posts
    295
    Another possibility (at least under 9i) is to use Hetergeneous services to let sqlplus access the output of the host command (done to a file with '>') as an external table.

    Joseph R.P. Maloney, CSP,CDP,CCP
    'The answer is 42'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width