Did you grasp the following two items from my earlier email?
- Identity_val_local
- select ... from final table...

On Tue, Feb 11, 2025 at 9:59 AM Rob Berendt <robertowenberendt@xxxxxxxxx>
wrote:

Let me explain it to you with code

CREATE OR *REPLACE* TABLE rob.doug
(
Order_number *INTEGER* NOT NULL
generated always as identity
constraint Doug_table_primary_key PRIMARY KEY,
customer_name *VARCHAR*(*100*) ALLOCATE(*20*)
);
create table rob.doug_orderline
(
order_number *integer* not null
constraint Doug_header references rob.doug on delete restrict on
update restrict,
order_line *integer* not null
);
*insert* into rob.doug (customer_name) values('Bubba');

*-- What was the order number just created?*values *identity_val_local*();
*insert* into rob.doug_orderline (order_number, order_line) values (
*identity_val_local*(), *1*);
select * from rob.doug;
select * from rob.doug_orderline;

*-- alternative to identity_val_local()*select order_number
*-- into :NewestOrderNumber* from final table ( *insert* into
rob.doug (customer_name) values('Jim Bob')
);

On Tue, Feb 11, 2025 at 9:25 AM DEnglander--- via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

Thank you.

That is what I thought.

The reason I asked is this: I have a table that I would like to have
function as the Parent. I want to possibly have other tables have
referential integrity with it. If I have an Identity number as the key
[as
opposed to a Vendor Number for example], then how would I set something
like: A Child table's Vendor Number column must have a value that exists
in the Parent's Vendor Number column. Unless I'm missing something, it's
not as easy using Identity columns only, since you first have to get the
Identity column of the Vendor whose associated row you want to write in
the Child table. Sounds like extra steps to me, but maybe it's worth it?

Thanks again,

Doug



"CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the
attachments accompanying it) contain confidential information belonging to
the sender. The information is intended only for the use of the intended
recipient. If you are not the intended recipient, you are hereby notified
that any disclosure, copying, distribution or the taking of any action in
reliance on the contents of the information is strictly prohibited. Any
unauthorized interception of this transmission is illegal under the law.
If you have received this transmission in error, please promptly notify the
sender by reply e-mail, and then destroy all copies of the transmission."
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2025 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.