Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: Db2 Stored Procedure


    I am pretty new to Db2 Stored procedure and would like to have any help in this regard

    I am writing an outbound script to extact data from Db2 tables to a flat file.

    The Db2 column name is COUNT VARCHAR 5

    The output colum name is COUNT1 with VARCHAR 7

    so if the value of the COUNT is 234

    I want in the output column COUNT1 the value of 0000234 as it always has to be output with length 7 digits

    If the value of count is 2345 the value in the output column COUNT1 will be 0002345 meaning i will have to add 000 to make the Column COUNT1 of length 7 always

    Can any one write the SQL Syntax for this please


    Gautam S

  2. #2
    Join Date
    Jun 2002
    Something like...

    right('0000000'||count1, 7)

Posting Permissions

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