Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    3

    Unanswered: how do one execute a command line program

    Please Help,

    I would like to know how to execute a command line program i.e. a batch file in dos and passing parameters to it.

    I am familiar with MS SQL's way - herewith a simple stored procedure in MS SQL which I would like to be converted in DB2 syntax;

    CREATE procedure ebc
    @cycle varchar(40)
    as
    declare @cmdstr varchar(50)
    declare @tmpid integer

    select @tmpid = (select id + 1 from ebc_counter)
    update ebc_counter
    set id = @tmpid

    select @cmdstr = ''
    select @cmdstr = 'c:\test.bat' + ' ' + @cycle + ' ' + convert(varchar(10),@tmpid)

    exec xp_cmdshell @cmdstr


    Hope someone can help me!

    Thanks

  2. #2
    Join Date
    Oct 2001
    Location
    Bangalore
    Posts
    186
    Hi Jacobm,

    DB2 procedures do not allow anything else but only SQL commands.
    You try that in a function, i mean UDF's.

    Cheers,
    Prashant

Posting Permissions

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