You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with ins as (
insert into table1 (email)
values('[email protected]')
returning userid
)
insert into table2 (userid, name, address)
select userid, 'joe', '123 test Dr'from ins
this seams like a natural thing to do, if the value you need to insert is split in multiple tables,
and all inserts should fail if one of them fails, without another insert being possible in between.
This discussion was converted from issue #702 on June 08, 2024 08:55.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is it possible to make a query like this in beam?
this seams like a natural thing to do, if the value you need to insert is split in multiple tables,
and all inserts should fail if one of them fails, without another insert being possible in between.
The query above is taken from:
https://stackoverflow.com/questions/63821001/insert-result-from-one-insert-query-into-another-insert
(And is this the right place to ask a question like this, or would you prefer it another place?)
Beta Was this translation helpful? Give feedback.
All reactions