Expand my Community achievements bar.

Sequence Generation for a particular attribute

Avatar

Level 1

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

4 Replies

Avatar

Level 10

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

Avatar

Level 1

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

Avatar

Community Advisor

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

Avatar

Level 1

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