Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2007
    Posts
    28

    Talking Unanswered: Issuing creating self defined data types in DB2 v8.2, n00b question.

    Hello everyone.

    I'm trying to make a undefined data type (UDT) in DB2 v8.2
    but there seems to be an error at line 3 it says.

    CREATE SCHEMA"M";

    CREATE DISTINCT TYPE OBJECTLINK AS DECIMAL (9,2);

    CREATE TABLE "M".
    "agent"
    (
    "aIndMACAddress"
    OBJECTLINK
    ,
    "EventCorrelator"
    VARCHAR(1024)
    ...
    ....

    Any ideas on the syntax or what I'm doing wrong? I'm putting this in the .ddl and loading it with Rational Software Architect.

    If I take out the UDT OBJECTLINK everything works fine.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    What happens if you fully qualify the type_name?

    Andy

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Also what is the exact error you are getting?

    Andy

  4. #4
    Join Date
    Aug 2007
    Posts
    28
    Ahh, N/M I fixed it kinda....

    I didn't want it to be decimal I just had an example to see if it worked.

    But If I changed the code to
    CREATE DISTINCT TYPE OBJECTLINK AS DATALINK;

    It loads into Rational Software Architect just fine! thanks!
    IBM: Tivoli zSeries Co-op

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Btw: UDT stands for "user-defined type".
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  6. #6
    Join Date
    Aug 2007
    Posts
    28
    ahh, thanks!

    I don't know why I was calling it undefined hah, oh well.
    IBM: Tivoli zSeries Co-op

  7. #7
    Join Date
    Aug 2007
    Posts
    28
    Hm....

    I'm running into another problem:

    I don't understand why this works:
    CREATE DISTINCT TYPE OBJECTLINK AS DATALINK;

    But right under this line I put:
    CREATE DISTINCT TYPE Anoymous254 AS VARCHAR(254);



    The script file was successfully reverse engineered with the following error messages. Click Finish to generate the model file.
    There are problems in parsing the script file.

    <<================================================ ============

    Parser error on:



    Token Kind : 10

    StartOffset : 79

    Line Number : 2

    Col Number : 34

    Length : 2

    Token Text : AS

    Error Msg : "LONG"expected after this token



    ================================================== ==========>>



    Any ideas Why this will work with DATALINK but not VARCHAR(252);


    In the .ddl I have:

    CREATE DISTINCT TYPE OBJECTLINK AS DATALINK;
    CREATE DISTINCT TYPE Anoymous254 AS VARCHAR(254);

    CREATE TABLE "MSM".
    "bridgeLink"
    (
    "nodeAddress"
    --1.3.18.0.0.3315.8.7.2
    Anoymous(254)
    ,
    "relatedBridgeFunction"
    --1.3.18.0.0.3573
    OBJECTLINK
    ,
    "aSegmentNumber"
    --1.3.18.0.0.5273
    VARCHAR(1024)
    ...
    ...
    );


    What I don't understand is:
    This is the correct syntax after looking it up:

    CREATE DISTINCT TYPE T_SHOESIZE AS CHAR(2)
    WITH COMPARISONS


    So why does it like mine if this is okay?

    Hm....it seems to be,
    if I use the name like ANO_NAME , it works, but without the underscore its upset.
    Last edited by mr_coffee; 09-16-07 at 23:28.
    IBM: Tivoli zSeries Co-op

Posting Permissions

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