DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Executing Unix Command from PLSQL procedure

  1. #1
    Join Date
    Oct 2000
    Posts
    21
    Can U execute UNIX command from PLSQL procedure
    example I have procedure 'test'
    SQL > exec test('ls') --> I passed ls as a argument

    How to implement ?
    Sanjay
    sanjay

  2. #2
    Join Date
    Jul 2000
    Posts
    521
    write a Pro*C program that makes use of db pipes and run it as a daemon. A sample program has been included in RDBMS concepts manual.
    svk

  3. #3
    Join Date
    Sep 2001
    Location
    Dallas, TX
    Posts
    27
    Hi,

    You should be able to use the host command.

    Host (ls) will get you the necessary results.

    BK

  4. #4
    Join Date
    Mar 2001
    Posts
    314
    Originally posted by bkrish

    You should be able to use the host command.
    BK

    ...... and how do you propose to use the host command within a plsql procedure ?

    -amar

  5. #5
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    688

  6. #6
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    688
    I think you know now how to call external procedure from PL/SQL?

    [Edited by kgb on 09-07-2001 at 12:29 PM]

  7. #7
    Join Date
    Mar 2001
    Posts
    314
    kgb,

    Are you saying that we can use the sQL host command from within a plsql procedure ? I know we can execute os commands using external procedures or java, but being able to use the sql host command from within plsql is new to me Mind explaining how to do it please ?

    -amar

  8. #8
    Join Date
    Sep 2001
    Location
    Dallas, TX
    Posts
    27

    Calling OS Command using PL/SQL SP/SF

    Well,

    In my opinion the flow is always from OS to Oracle using position parameter as one of the alternatives. One of the approaches for PL/SQL to check for anything on OS would be using utl_file package.

    BK

  9. #9
    Join Date
    Mar 2001
    Posts
    314

    Re: Calling OS Command using PL/SQL SP/SF

    Originally posted by bkrish
    One of the approaches for PL/SQL to check for anything on OS would be using utl_file package.
    as I understand, you can use the utl_file package to read from or write to (create if necessary) OS file(s). Mind telling me how to "check for anything on OS" using utl_file please ?

    -amar

  10. #10
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    688
    Sorry, you are wrong - I didn't tell that.
    ===========================

    Originally posted by amar
    kgb,
    Are you saying that we can use the sQL host command from within a plsql procedure ? I know we can execute os commands using external procedures or java, but being able to use the sql host command from within plsql is new to me Mind explaining how to do it please ?
    -amar

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