user3564550
user3564550

Reputation: 23

Apex data load by using a page item as a foreign key

In my Apex application i have successfully created a data loading page to upload newly purchased items with their prices, so far everything works perfectly except, in my database table, these new purchases (rows of data) need to be related to the sale where it happened, for example let's say "X" employee did a purchase for some items in "Y" date, i would first need to enter this sale and then enter the data (every purchased item) from the Excel file and id_sale from the page item stored in the session. basically what i need is a static number (id_sale) for every row inserted.

i tried to add a column in the "data load" process with "column type = SQL expression" and the SQL expression is :

select :P10_ID_SALE from dual;

i get this error

ora-01008 not all variables bound 

apparently this is not the right way to do it, so how can i use a page item in a data load process?

Upvotes: 0

Views: 188

Answers (1)

Koen Lostrie
Koen Lostrie

Reputation: 18665

Sounds like this doesn't support page items, I'm getting the same error. I think the easiest workaround is to make this a 2 step process.

  1. Load the data into a collection or a temporary table
  2. Move the data into the actual table and set the foreign key value to whatever you need it to be during that step.

Alternatively, try to access the page item with the v function. Set SQL Expression to v('P10_ID_SALE')

Upvotes: 1

Related Questions