Fwd: table name

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Nov 28 2003 - 15:03:57 EST

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

    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:04:00 EST