RE: table name

From: Leonardo R. Nunes (leonard..umersoft.com)
Date: Fri Nov 28 2003 - 16:23:40 EST

  • Next message: Andrus Adamchik: "Re: Long X BigDecimal"

    > For now you can
    >paste this SQL in whatever sql tool you are using and recreate
    >customized stored procedure and AUTO_PK_SUPPORT table to suit your
    >needs.

    Yes, I did it.
    The email was just a suggestion to improve the modeler :)

    Tks,
    Leonardo.

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: sexta-feira, 28 de novembro de 2003 17:04
    To: cayenne-use..bjectstyle.org
    Subject: Fwd: table name

    On Nov 28, 2003, at 2:24 PM, Leonardo R. Nunes wrote:

    > This is the autopkScriptfrom the modeler user interface. The maximum
    > length of my table name is 32 characters.
    > I suggest to verify the table name in the modeler user interface. Or
    > change this varlength to my table name length.

    You should realize that this stored procedure and AUTO_PK_SUPPORT table
    are shared by *all* tables to generate their PKs, possibly even outside
    of Cayenne apps.

    > CREATE PROCEDUREauto_pk_for_tabl..nameVARCHAR(32), @pkbatchsizeINT AS

    > BEGINBEGINTRANSACTION UPDATE AUTO_PK_SUPPORT set NEXT_ID = NEXT_ID +
    >..kbatchsizeWHERE TABLE_NAME = @tnameSELECT NEXT_ID FROM
    > AUTO_PK_SUPPORT WHERE TABLE_NAME =..nameCOMMIT END

    I believe 32 was originally used since this is a limit on the table
    name size in Sybase (it's been a while, I can be wrong here). We should
    probably bump it up to 255 (VARCHAR limit on Sybase). For now you can
    paste this SQL in whatever sql tool you are using and recreate
    customized stored procedure and AUTO_PK_SUPPORT table to suit your
    needs.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Nov 28 2003 - 15:20:31 EST