Skip to main content
Known Participant
Feb 25, 2024 10:42 AM UTC
Question

In CDT How to handle the table without having primary key?

If a database table do not have any primary key, then how we can handle this table in Appian CDT?

    7 replies

    stefanhelzle0001
    Brainy
    Feb 25, 2024 1:10 PM UTC

    Not. Appian requires a primary key. If you do not have one, you could create a view that adds an artificial PK.

    Known Participant
    Feb 25, 2024 2:01 PM UTC

    How can we update the data in that table if we are creating the view?

    mathieud0001
    Genius
    Feb 25, 2024 2:33 PM UTC

    If you are creating a view, simply add a new column for the artificial or composite key.

    CREATE VIEW my_view AS
    SELECT col1, col2, CONCAT(col1, '_', col2) AS composite_key
    FROM my_table;

    davidj137213
    Brainy
    Feb 26, 2024 9:15 AM UTC

    Why do you have one table without a primary key? Add it with autoincrement at least , and you will we able to create your cdt.

    mikes0011
    Brainy
    Feb 26, 2024 6:00 PM UTC
    then how we can handle this table in Appian

    By updating it to add a Primary Key column.

    The Expression Guru