Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2009
    Posts
    31

    Unanswered: Stored procedure for db2 copy data from existing table to another table

    Hi All,

    I have a requirement to copy all data from an existing table to another table. I need to write a stored procedure for that. COuld you please help me write a stored procedure. Ihave never written one before. so will be a good learning experience for me.

    Thanks

    dbsam

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    I'm not sure if you really need a stored procedure for that, but there are some examples in the manual: README

  3. #3
    Join Date
    Dec 2009
    Posts
    31
    Thanks so much for your reply. Could you please provide me the link

    dbsam

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Copying data can be done with a simple "INSERT INTO <target> SELECT <column-list> FROM <source>". The only thing why you want to do it more complicated is to execute intermediate COMMIT statements.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338
    If you do the above with shell scripts its easier and simple. But still if there is a need to copy and move data using Stored Procedure in DB2, then you can use ADMIN_CMD stored procs "ADMIN_CMD procedure is used by applications to run administrative commands using the SQL CALL statement. "

    Jayanta Datta
    DB2 UDB DBA
    IBM India, Global Delivery
    New Delhi

Posting Permissions

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