[Oracle] Insert issue

[Oracle] Insert issue


since I cannot work with the default create-action generated by Outsystems, due to circumstance I have to revert back to old-skool stuff /sadpanda

I need to have 2 queries
SELECT [sequence].nextval from {DUAL}
VALUES (@Inp1, @Inp2, @Inp3)
This is very suboptimal, because we have 2 roundtrips. when entity changes, we need to change the insert. we have X inputparameters based on X-attributes. How can I make this better and more developer-friendly? Can I make it 1 query and automatically get the id back?
I've used something like this before...

insert into my_table(col_a,col_b)
select my_seq.nextval, a
(select 'something' as a from dual)

Not really a solution reply, but was just wondering what the original problem was and think it's the followup of this thread, right?
Did you have the AutoNumber checkbox checked in integration studio on that attribute?
Because, regardless of what is the null value configured the Create queries should specify the primary key at all and allow the triggers to work.

João Rosado
well, sort of.

The checking on/off of autonumber doesn't help much.
there will be a 0 inserted in the database.
and since I don't want to change the pl/sql (this means 800 table triggers, regression test etc.)
I'm currently stuck with this workaround, that is.

the select for nextval still applies, then indeed the createAction is called :)

The outsystems platform is supposed to ommit the column in the create action if it is auto-number and a 0 (NullIdentifier()) is supplied in Service Studio. This shouldn't result in a 0 being inserted.

What is the query that's being executed as part of the INSERT statement? Is it specifying the auto-number column? If so, please report the bug to OutSystems support so we can properly follow up.
the plot thickens...

I thought I checked autonumber and it failed to work.
guess I forgot to update something..