Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make primary key using cpu() function ??

Status
Not open for further replies.

powerbuilde

Programmer
Oct 2, 2010
29
0
0
EG
I read article that discuss how to make primary key using Using Autoincrementing Columns from a PowerBuilder DataWindow
can i use primary key that generate from function cpu()and to reduce confusion i use number(CONCATENATE(A1,B1)) where A1= string(max(number)+1) and B1 = string(cpu())
 
By definition an Autoincrementing column has its value assigned by the database when a record is inserted. Although you can control the starting value of this (in most databases), you cannot dictate the key value itself.

To use your method you would need to generate a key prior to inserting the record and then assign that key to the proper column so that it is inserted into the table. You would not use the autoincrementing feature at all.

Matt

"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top