Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2012
    Posts
    1

    Red face Unanswered: call procedure in loop

    Hello DB Experts,

    I would like to create on Stored Procedure. I am expecting logic should be as follows. could you please hlep some one

    SP input parameter : IN "@MACH_CO_ID" VARCHAR(15000), IN "@TIMEZONEOFFSET" DECIMAL(4,2), IN "@STARTTIME" TIMESTAMP, IN "@ENDTIME" TIMESTAMP, IN "@LICENSETYP" INTEGER

    Step 1: execute following select Query and with this

    SELECT MACH_CO_ID,
    MACH_ID,
    VIS_BEG_TS
    AS VIS_BEG_TS_GMT,
    COALESCE (
    VIS_END_TS,
    (SELECT CURRENT TIMESTAMP
    - CURRENT TIMEZONE
    FROM sysibm.sysdummy1))
    AS VIS_END_TS_GMT
    FROM SHRDM.CO_VIS
    WHERE CO_ID IN
    (84812,85974)

    Step2 : based on above query results I want to call Stored Procedure SP_TIME_AGGR_VIS_TEST1

    Step 3: I want to call Stored Procedure SP_TIME_MONTH_AGGR_VIS_TEST2

    Step 4 : results should be all the out put from SP_TIME_AGGR_VIS_TEST1 & SP_TIME_AGGR_VIS_TEST2 call.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    have a look at the samples directory below sqllib
    many samples for sp have been provided
    or
    CREATE PROCEDURE (SQL)
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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