Highlighted

Sequence Generation for a particular attribute

Avatar

Avatar

zebashaikhh

Avatar

zebashaikhh

zebashaikhh

02-12-2018

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

Replies

Highlighted

Avatar

Avatar

pablo_rosero1

Avatar

pablo_rosero1

pablo_rosero1

02-01-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

Highlighted

Avatar

Avatar

wodnicki

MVP

Avatar

wodnicki

MVP

wodnicki
MVP

02-01-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

Highlighted

Avatar

Avatar

zebashaikhh

Avatar

zebashaikhh

zebashaikhh

24-01-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

Highlighted

Avatar

Avatar

zebashaikhh

Avatar

zebashaikhh

zebashaikhh

24-01-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