× 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.




Thanks Chuck, now the SQL statements don't change DDS in any way...right?





-----Original Message-----
From: CRPence <CRPbottle@xxxxxxxxx>
To: midrange-l <midrange-l@xxxxxxxxxxxx>
Sent: Tue, Feb 14, 2012 3:34 pm
Subject: Re: fields in a PF


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
-
his is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
o post a message email: MIDRANGE-L@xxxxxxxxxxxx
o subscribe, unsubscribe, or change list options,
isit: http://lists.midrange.com/mailman/listinfo/midrange-l
r email: MIDRANGE-L-request@xxxxxxxxxxxx
efore posting, please take a moment to review the archives
t http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.