Can DB2 stored procedure run a .sql file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ricky
    New Member
    • Jul 2012
    • 4

    #1

    Can DB2 stored procedure run a .sql file?

    I am using Db2 9.5 LUW. Is there a way in DB2 stored procedure can run a .sql file? Like the following:

    Code:
    sql file: abc.sql
    insert into tbl values ('ABC','Very Long Text here');
    
    SP: SP_TEST
    CREATE PROCEDURE SP_TEST()
       language sql
       BEGIN
       --Read and run from C:\MyPath\abc.sql
    END@
    Last edited by Rabbit; Jan 2 '14, 04:07 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
  • Anas Mosaad
    New Member
    • Jan 2013
    • 185

    #2
    You can use execute immediate to run dynamic queries

    Comment

    Working...