Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pass parent ID to tabular form

Jen HuJul 14 2014 — edited Jul 15 2014

Hello,

      I created a page with two forms: one is like parent form and the another one is tabular form(child). After the parent creat a row, i need to insert several rows for the child form.

I want to know how to pass the parent ID to the tabular form.

Thanks,

Jennifer

Comments

Gaz in Oz

Your update syntax suggests you are working with MYSQL db.

It always helps to format your code into a more readable and maintainable style, for example:

Update products,

       orderdetails,

       orders

set    products.UnitsInStock = (products.UnitsInStock - orderdetails.Quantity),

       ShippedDate = current_date()

where  products.ProductID = orderdetails.ProductID

and    orders.OrderID = orderdetails.OrderID

and   (ShippedDate is null and

       orderdetails.Quantity < UnitsInStock)

and    orders.OrderID  = 11039;

The fact the update is updating rows you don't want it to means you haven't got the join to the three tables correct.

Write it as a select statement first then convert it into an update when you are sure it will update the rows you want it to.

...and as this looks like a mysql question you be better off asking your question here or

here http://forums.mysql.com/

John Thorton

Gayathri Venugopal wrote:

Hi, I need to update UnitinStock and Shipped Date of products based on these conditions.

1)When the shipped date is null and

2) when Quantity < Unit in stock.

But my query is updating Shipped date of all the orders even when this condition Quantity < Unit in stock is not satisfied .

How do I satisfy these 2 conditions and update colums:

Update products,orderdetails,orders

set products.UnitsInStock = (products.UnitsInStock - orderdetails.Quantity), ShippedDate = current_date()

where products.ProductID =orderdetails .ProductID and orders.OrderID = orderdetails.OrderID

and (ShippedDate is null and orderdetails.Quantity < UnitsInStock) and orders.OrderID = 11039

Please click on URL below & provide details as stated in #5 - #9 inclusive

How do I ask a question on the forums?

Please post full results from SQL below

SELECT * FROM V$VERSION;

mathguy

You were told two days ago, in a different thread you started, that this is NOT A MySQL FORUM.   Repeat:  This is NOT A MySQL FORUM.  Is that hard to understand?

Timo Hahn

***Moderator action (Timo): User, I moved you thread to the MySql space as it isn't about OracleDB.***

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 12 2014
Added on Jul 14 2014
1 comment
624 views