Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

SetCollation of Index 11 May 2022 11:29 #22407

  • hilberg.it


  • Posts: 50
  • Hi,

    I am need to set the collation of one or all indices to "oem:de_DE" in ADS Server. This can be done manually through the Advantage Data Architect using Table Designer in the additional index definitions. But can I somehow set this property already in my code that reindexes my tables?

    The code starts with something like this
    SetCollation(#CLIPPER)
    SetAnsi(false)
    SetInternational (#CLIPPER)
    SetDecimalSep  (Asc(","))
    SetThousandSep (Asc("."))
    SetDateCountry(GERMAN)
    SetEpoch(1990)
    SetCentury(true)
    SetExclusive(FALSE)
    SetDeleted(true)
    Enable3dControls ()
    RDDSETDEFAULT("AXDBFCDX")

    Later I call "DbReindex()" which will create my CDX files.
    Could I use "AX_SetCollation("...")" or change "SetCollation(#CLIPPER)" to "oem:de_DE"?

    Thanks

    Please Log in or Create an account to join the conversation.

    SetCollation of Index 11 May 2022 13:55 #22408

    • robert
    • robert's Avatar


  • Posts: 2834
  • You can indeed use AX_SetCollation() to set a new collation for the next table open or table creation operation.
    The function returns the previous setting.
    The setting is stored in the X# runtime state and used by the ADS RDDs.
    Please note that X# uses the same collation for all indexes by default.
    With some hacking you could probably access and change the (internal) _Collation field in the ADS RDD object and change it between the creation of different indices.
    If you add an enhancement request in our GitHub repo I can also try to add a way to change that using the DbInfo() function for a next build.


    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    SetCollation of Index 11 May 2022 14:47 #22409

    • hilberg.it


  • Posts: 50
  • Thanks Robert, sounds promising. Do you know what are valid arguments for AX_SetCollation()? I tried using "oem" and "oem:de_DE", but couldn't see any effect in Advantage Data Architect.

    Please Log in or Create an account to join the conversation.

    SetCollation of Index 11 May 2022 17:58 #22410

    • robert
    • robert's Avatar


  • Posts: 2834
  • I would advise to check the ADS documentation for this.
    We are passing the string literally to ADS

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    SetCollation of Index 12 May 2022 00:49 #22414



  • Posts: 68
  • Hope that helps:
    devzone.advantagedatabase.com/dz/webhelp..._ax_setcollation.htm

    Description

    This function specifies which collation language to use when opening tables, opening cursors, or creating tables. By default, no collation language is set and the client will use the language set by the Advantage Database Server.

    Note Collation languages are only valid with ADT and VFP tables. For all other table types, the collation language is ignored.


    HTH

    Gerhard

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1