Professional Web Applications Themes

Help need to porting from MS SQL to DB2 8.1 - IBM DB2

Dear All, I porting my MS SQL stucture and those UDF to db2 v8.1. I using the IBM Migation tools to do it, all the stucture are migrate success (changing the script a bit on data type), but i fail to move some of the UDF because those UDF using the MS SQL system function that not exist in db2. Do any one know any URL can i find those mapping on system function? My program and UDF use a lot the MS SQL function STR(Int, MaxLan, DecimalDigit) Do any one know how to script this function in DB2. Note ...

  1. #1

    Default Help need to porting from MS SQL to DB2 8.1

    Dear All,
    I porting my MS SQL stucture and those UDF to db2 v8.1.
    I using the IBM Migation tools to do it, all the stucture are migrate
    success
    (changing the script a bit on data type), but i fail to move some of the UDF
    because those UDF using the MS SQL system function that not exist in db2.
    Do any one know any URL can i find those mapping on system function?
    My program and UDF use a lot the MS SQL function STR(Int, MaxLan,
    DecimalDigit)
    Do any one know how to script this function in DB2.

    Note : Maxlan and DecimalDigit are optional parameter.
    --
    Best Regards,
    James Hong


    James Hong Guest

  2. #2

    Default Re: Help need to porting from MS SQL to DB2 8.1

    "James Hong" <jhcgonebox.com> wrote in message
    news:3f690d27$1_2news.tm.net.my...
    > Dear All,
    > I porting my MS SQL stucture and those UDF to db2 v8.1.
    > I using the IBM Migation tools to do it, all the stucture are migrate
    > success
    > (changing the script a bit on data type), but i fail to move some of the
    UDF
    > because those UDF using the MS SQL system function that not exist in db2.
    > Do any one know any URL can i find those mapping on system function?
    > My program and UDF use a lot the MS SQL function STR(Int, MaxLan,
    > DecimalDigit)
    > Do any one know how to script this function in DB2.
    >
    > Note : Maxlan and DecimalDigit are optional parameter.
    > --
    > Best Regards,
    > James Hong
    >
    Usually the best way to get a response on the this forum is to exactly
    explain how the MS SQL function works and then ask if there is a similar
    function in DB2. In this way, those who don't know about MS SQL Server
    functions can help you.

    Also, you should check out the manuals (can be downloaded from the IBM
    site).

    You might also check out this porting guide, but don't know if it answers
    this specific question:
    [url]http://www7b.boulder.ibm.com/dmdd/library/techarticle/0203rada/0203rada.html[/url]


    Mark A Guest

  3. #3

    Default Re: Help need to porting from MS SQL to DB2 8.1

    The equivalent to the MS SQL STR function in DB2 is the CHAR function;
    however, DB2 doesn't support the MaxLen (not maxlan) parameter. You can
    achieve the same effect by wrapping the call to CHAR in a call to INSERT.

    "James Hong" <jhcgonebox.com> wrote in message
    news:3f690d27$1_2news.tm.net.my...
    > Dear All,
    > I porting my MS SQL stucture and those UDF to db2 v8.1.
    > I using the IBM Migation tools to do it, all the stucture are migrate
    > success
    > (changing the script a bit on data type), but i fail to move some of the
    UDF
    > because those UDF using the MS SQL system function that not exist in db2.
    > Do any one know any URL can i find those mapping on system function?
    > My program and UDF use a lot the MS SQL function STR(Int, MaxLan,
    > DecimalDigit)
    > Do any one know how to script this function in DB2.
    >
    > Note : Maxlan and DecimalDigit are optional parameter.
    > --
    > Best Regards,
    > James Hong
    >
    >

    Mark Yudkin Guest

  4. #4

    Default Re: Help need to porting from MS SQL to DB2 8.1

    Have a look at:
    [url]http://www7b.boulder.ibm.com/dmdd/library/techarticle/0303rada/0303rada.html[/url]

    Other resources: are here:
    [url]https://www6.software.ibm.com/dl/db2_03/migtkt-p[/url]

    James Hong wrote:
    > Dear All,
    > I porting my MS SQL stucture and those UDF to db2 v8.1.
    > I using the IBM Migation tools to do it, all the stucture are migrate
    > success
    > (changing the script a bit on data type), but i fail to move some of the UDF
    > because those UDF using the MS SQL system function that not exist in db2.
    > Do any one know any URL can i find those mapping on system function?
    > My program and UDF use a lot the MS SQL function STR(Int, MaxLan,
    > DecimalDigit)
    > Do any one know how to script this function in DB2.
    >
    > Note : Maxlan and DecimalDigit are optional parameter.
    Blair Adamache Guest

  5. #5

    Default Re: Help need to porting from MS SQL to DB2 8.1

    Other samples:

    [url]http://www7b.boulder.ibm.com/dmdd/library/samples/db2/0205udfs/index.html[/url]

    Blair Adamache wrote:
    > Have a look at:
    > [url]http://www7b.boulder.ibm.com/dmdd/library/techarticle/0303rada/0303rada.html[/url]
    >
    >
    > Other resources: are here:
    > [url]https://www6.software.ibm.com/dl/db2_03/migtkt-p[/url]
    >
    > James Hong wrote:
    >
    >> Dear All,
    >> I porting my MS SQL stucture and those UDF to db2 v8.1.
    >> I using the IBM Migation tools to do it, all the stucture are migrate
    >> success
    >> (changing the script a bit on data type), but i fail to move some of
    >> the UDF
    >> because those UDF using the MS SQL system function that not exist in db2.
    >> Do any one know any URL can i find those mapping on system function?
    >> My program and UDF use a lot the MS SQL function STR(Int, MaxLan,
    >> DecimalDigit)
    >> Do any one know how to script this function in DB2.
    >>
    >> Note : Maxlan and DecimalDigit are optional parameter.
    >
    >
    Blair Adamache Guest

  6. #6

    Default Re: Help need to porting from MS SQL to DB2 8.1

    Dear All,
    Thanks for the help from Mark A, Mark Yudkin and Blair Adamache, abd sorry
    for my late reply.
    The Sample SQL query in MS SQL as below
    SELECT id, name, ("Payment Amount " & STR(payment, 8, 2) ) AS PayRemark
    FROM bill

    the result will be

    id name PayRemark
    --- --------- ---------------------------
    1 James Payment Amount 123.40
    2 Jess Payment Amount 12345.67

    after convert the query using DB2 Migration Tool Kit, the query being change
    to
    SELECT id, name, ("Payment Amount " || MS7.STR(payment, 8, 2) ) AS PayRemark
    FROM bill
    which is no valid function as MS7.STR, so replace it as CHAR(payment)
    I have a problem here
    1. My data type is Decimal(12,4) , and the result display as 0000123.4000,
    which having extra zero.
    2. I have data type Decimal(12,4) and Decimal(6,2), how do write a UDF with
    same name STR to process both data type?
    --
    Best Regards,
    James Hong
    "Blair Adamache" <> wrote in message
    news:bkcd5c$nmk$torolab.ibm.com... [/ref]
    http://www7b.boulder.ibm.com/dmdd/library/techarticle/0303rada/0303rada.html [/ref][/ref]
    db2. 
    > >
    > >[/ref]
    >[/ref]


    James Guest

Similar Threads

  1. Porting from CS to 10... can it work?
    By JeffreyBower@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 3
    Last Post: April 13th, 03:40 PM
  2. porting to windows NT
    By Shaunn Johnson in forum PERL Beginners
    Replies: 3
    Last Post: January 30th, 02:26 PM
  3. porting to pc
    By cwf prod webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 1
    Last Post: August 12th, 02:56 PM
  4. Porting code to Mac (part 2)
    By Eric Albert in forum Mac Programming
    Replies: 0
    Last Post: August 10th, 01:08 AM
  5. Porting code to Mac
    By Stephen Fraser in forum Mac Programming
    Replies: 2
    Last Post: August 3rd, 04:16 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139