0
votes

I've created a form which I would like it to be able to insert 3 records at once in one table.

print screen of form page with modal form

GUIA_TRANSPORTE is a value passed from the page to the modal.

At the moment,

If I only fill the first row of input items, it inserts on the table the correct GUIA_TRANSPORTE value but Product and quantidade inserts as null values.

If I only fill the last row of input items, it inserts that row with the correct values into the table.

If I fill everything, it inserts only the last row of input items into my table.

So, how can I make it insert all 3 rows with the correct values? and also being able to fill only the first row of items and it to insert the right values (aka not null) into my table

1
You're almost certainly going to have to describe the implementation/ show your code to get any help. It is very unlikely that someone is going to be able to tell from a screenshot of your application's layout why your application's code isn't working the way you want it to.Justin Cave
I think the code i use to pass the value onto the modal dialog and to open it is irrelevant since this applies to every form when i try to make it into a multi-row insertion form.ItzBunzy
I don't think the code to pass the value to the modal is relevant, but how was your modal form constructed? Is it a classic report or regular form? Are there always three rows or can that vary? What happens when you submit the page? Are you executing custom PL/SQL code (if so, that would be relevant)?Dan McGhan

1 Answers

0
votes

I seems that you are using automatic row processing when the page is submitted, but you should probably use PL/SQL code in the page processing:

IF (Product1 is not null and quantidade1 is not null) then
    insert into TABLENAME (GUIA_TRANSPORTE, Product, quantidade) values (PXX_GUIA_TRANSPORTE, PXX_Product1, PXX_quantidade1 )
END IF;

IF (PXX_Product2 is not null and PXX_quantidade2 is not null) then
    insert into TABLENAME (GUIA_TRANSPORTE, Product, quantidade) values (PXX_GUIA_TRANSPORTE, PXX_Product2, PXX_quantidade2 )
END IF;

IF (PXX_Product3 is not null and PXX_quantidade3 is not null) then
    insert into TABLENAME (GUIA_TRANSPORTE, Product, quantidade) values (PXX_GUIA_TRANSPORTE, PXX_Product3, PXX_quantidade3)
END IF;

Good luck!