Sequence Generation for a particular attribute | Community
Skip to main content
zebashaikhh
December 2, 2018

Sequence Generation for a particular attribute

  • December 2, 2018
  • 2 replies
  • 3597 views

Hi,

       I want to create sequence logic for a particular attribute of the schema. When I am trying to create it with the existing solution its creating a new attribute(Primary Key/ @id) and generating the sequence logic on that attribute. As per the requirement sequence should be created with the current primary key of the table for eg  recommendation Id. It shouldn't create a new attribute.

Will be grateful if you can provide me with a solution

Thank You

Zeba Shaikh

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

pablo_rosero1
Level 9
January 2, 2019

Hi Zeba,

Depending on what you're trying to accomplish, a way to do it is to keep the primary key using an Intersection.

See here: Adobe Campaign Help | Intersection

Hope this helps!

All the best,

Pablo

zebashaikhh
January 25, 2019

Hi,

   Thank you for your help

But we used an inbuilt syntax that can be used to auto create the sequence and the syntax is mentioned below

Inside the element we mentioned autopk="true" and pkSequence="auto_internalNameOfSchema_seq" which helps to create auto sequence starting from 1000 

Example-

<element autopk="true" label="Merchant Master" labelSingular="Merchant Master"

           name="mrchntMaster" pkSequence="auto_mrchntMaster_seq">

<attribute label="Merchant ID" name="id"/>

</element>

Note- It is possible with latest v7 and build 8949

Jonathon_wodnicki
Community Advisor
Community Advisor
January 2, 2019

Hi,

If you're trying to use an existing pk instead of autogenerated surrogate pk:

  1. Remove autopk="true" from root <element/>
  2. Add this as the first node under root <element/>, assuming @recommendationId is the table's pk:

    <key name="pk" internal="true">

      <keyfield xpath="@recommendationId"/>

    </key>

Thanks,

-Jon

zebashaikhh
January 25, 2019

Hi,

   Thank you for your help

But we used an inbuilt syntax that can be used to auto create the sequence and the syntax is mentioned below

Inside the element we mentioned autopk="true" and pkSequence="auto_internalNameOfSchema_seq" which helps to create auto sequence starting from 1000 

Example-

<element autopk="true" label="Merchant Master" labelSingular="Merchant Master"

           name="mrchntMaster" pkSequence="auto_mrchntMaster_seq">

<attribute label="Merchant ID" name="id"/>

</element>

Note- It is possible with latest v7 and build 8949