Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012

    Unanswered: connect to database via a stored procedure


    Just looking to know if their is a way to connect to a db2 database via a db2 stored procedure?

    I have searched online but can't find anything relevant.

    I tried the

    connect to databasename user .... using ....;
    db2 connect to databasename user ...using...;
    SQL EXEC CONNECT TO databasename.....
    I keep getting errors with the code.Sql does not like it.

    The reason I want this is because the procedure is meant to run once a night, so it will need an active database connection when it runs.

    Linux machine
    db2 version 10

    Thanks in advance

  2. #2
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    Stored procedures are stored (and executed) on the database server, so you have to be connected to the database _before_ you can access the procedure.
    "It does not work" is not a valid problem statement.

Posting Permissions

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