Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Database table without a key

Former Member
0 Likes
1,121

I would like to create a database table without a key.

Is that possible? How?

12 REPLIES 12
Read only

Former Member
0 Likes
1,093

No you cannot create a table without Primary key.

Try creating a View which doesnot require a key.

Read only

Former Member
0 Likes
1,093

It's not proposed to have tables without any key.

At least you can create a surrogated ID which identifies each line uniquely.

Read only

0 Likes
1,093

It doesn't allow me to create 1 without a key.

I get an error log saying

-specify a primary key

-Structure change at field level(convert table)

Regarding the surrogate key I thought about that but wanted an easier way out

Read only

0 Likes
1,093

Well i do need this worthless lumpn of data.

In a nutshell i require to validate whatever new entries come in to the table whether they are repeated or not.

1 method to circumvent this is to use sr. no as a key. And ill probably use that as my last resort.

Read only

0 Likes
1,093

Hello.

I would ask you to explain the goal of creating a table without key. That way we can all think in a workaround.

Regards.

Valter Oliveira.

Read only

0 Likes
1,093

Thanks guys

Already created a workaround

I appended a serial number on the leftmost column and made that my primary key

Whenever i run the prograam i just count the number of rows in the existing table and use that to generate thje serial number

Read only

Former Member
0 Likes
1,093

hi,

u cannot create a table without a key, at least u need to maintain one key, but u can create strctures without key

Read only

ThomasZloch
Active Contributor
0 Likes
1,093

If you tell me why you want to do that I will tell you if it can be done.

Without any key for quick access it's just a worhtless lump of data imho.

Thomas

Read only

0 Likes
1,093

So every sequentiel file is a worhtless lump of data?

Every GSAM Table in IMS-DB is a worthless lump of data?

Every internal table in a report without a key is a worhtless lump of data?

There are many things which dont need to be accessed via a key, a sequentiel access is enough.

In a relational database a table should have a key, and in the SAP environment a table must have a key.

Read only

0 Likes
1,093

Of course you are right, I was only thinking about the relational databases underlying the SAP applications.

On the other hand, some flat files I receive here with supposed FI postings are just what my quote suggests

Thomas

Read only

Former Member
0 Likes
1,093

Hi,

Even If you want to store some story with sevaral lines in the data base ,Each time you need the line number to enter the full story.

So create one index along with the mandt primary key.

You can not create a data base table without a key.

Regards,

Rama.

Read only

0 Likes
1,093

So create one index along with the mandt primary key.

That table can hold exakt one row