× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 14-Feb-2012 12:13 , fbocch2595@xxxxxxx wrote:

if I add a new field to a PF, is there a way the system can assign a
unique value to the new field without updating the field within the
program code? I've been told it can so I figured if anyone would
know how it would be you folks.

If an SQL TABLE is OK, then review this scenario:

<code>

/* setup; i.e. presumes existing PF is TABLE ID */
create table id (c char, d dec)
;
insert into id values(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)
; -- 5 rows inserted in ID in LIB
/* action: have database assign a unique value to the */
/* new\added column for all existing rows */
alter table id
add column i int not null generated always as identity
( start with 0 increment by 1 cycle)
add constraint id_i_pk primary key (i)
; -- ALTER completed for table ID in LIB
/* review the effect of the action */
select * from id
; -- report from the SELECT follows:
....+....1....+....2....+.
C D I
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
******** End of data ********

</code>

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.