Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2011
    Posts
    57

    Red face Unanswered: Stored Procedure in asynchronous way

    Hi everyone.

    I'm trying to run a SP in asynchronous way, i've tried to run it in a SP calling it a couple of times but it runs one after another, is anyway to run an SP without wait the result? i mean run the same procedure in a parallel way??

    thanks.

    Best Regards

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by ricci View Post
    run the same procedure in a parallel way??
    Create multiple sessions.

  3. #3
    Join Date
    Sep 2011
    Posts
    57
    you mean create different conexions to the base, don't you?

  4. #4
    Join Date
    Nov 2011
    Posts
    334
    Create mutilple process or threads ( it depends on your dev lang) to execute sp parallelly。。。

  5. #5
    Join Date
    Sep 2011
    Posts
    57
    Ok, I got what you mean, but what I forgot to mention is that i wanna call the procedure from command line not ussing an external dev lang, but according what you say will be better excecute from otre dev lang, won't be?

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    If you are using Linux/Unix then this is not really a DB2 question, but an OS question. You can do the following:

    create a shell script with the db2 commands in it called run_sp.sh:

    . $HOME/sqllib/db2profile
    db2 "connect to <db-name>"
    db2 "call XXXXXXXXXXXXXXXXX"

    Then from command line:

    chmod 775 run_sp.sh (this grants execute authority, needed just one time)

    Then run the following as many times as needed. They will run as background processes:

    nohup ./run_sp.sh &
    <enter>
    nohup ./run_sp.sh &
    <enter>
    nohup ./run_sp.sh &
    <enter>
    nohup ./run_sp.sh &
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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