Create a table in Table Transformer using function like Create Table, Varchar, Primary key

Dhiraj Kr_ Gupta
Contributor
April 23, 2024

I want to Create a table which would generate automatic unique I'd for each record in SQL. 

Can you suggest by using create table, varchar, etc,

1 answer

4 votes
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2024

Hi @Dhiraj Kr_ Gupta ,

To get a unique ID for a record, you may use the UUID() function: 

Tue 10-1.png

SELECT UUID() AS 'Universal Unique Identifier',
*
FROM T*

Tue 9-2.png

The IDs will be unique within the current source table but they will be updated every time you publish the page. 

So, if you need them as passwords, primary keys, etc. you may generate them once and then copy to a real column of your existing table.

If your case is that you have smth like Surname, Name, Department, Column 1 - Column N in your first table and Surname, Name, Department, Column N+1 - Column N+N in your second table, but you can't look up them because the surnames are not unique, you may use the following workaround: just concatenate the first three common columns.

As a result, you'll get a key column that is Surname + Name + Department. This column will be a unique one, so, you'll be able to look up your tables just fine.

Hope I was able to make myself clear.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events