0

I have a drop down box on a page in my oracle apex application, I'd like to use the drop down box which displays a company's data(company name) within the company table (which I have achieved); which the user can use to identify specifically what company they'd like to delete. I'd then like to use a button to delete the selected company, and that's what I cannot figure out.

So far I have got as far as using dynamic actions to delete every entry in the table.

Pseudo code for what I am trying to achieve:

SELECT COMPANY_ID FROM COMPANYLIST,
DELETE SELECTED;

Company list being the drop-down box name.

Description of the button and the action

enter image description here

1
  • 20 hrs. Does no one have an answer to this? @Dmitry Commented Dec 5, 2017 at 20:43

1 Answer 1

1

It sounds like you are just struggling with the delete statement?

It should be something like this.

DELETE FROM company
WHERE company_id = (SELECT company_id 
                    FROM companylist
                    WHERE upper(company_name) = upper(:P1_COMPANY_NAME) ); 

Replacing company with whatever your company table is called, and :P1_COMPANY_NAME with whatever your select list item is.

Sign up to request clarification or add additional context in comments.

5 Comments

The ':' selects the element on the page? in my case the drop down box.
Where is says "delete from company" and "select company_id from companylist" did you not mean to write them both the same? company = companylist?
Yes : references the page item. If it is just one table then they will both be company list yes, I assumed two tables from reading your first post.
Can you post your select list query?
It's fine now, it seems to be working. I had trouble as I was using the code in a dynamic action, however using it instead in a process seemed to work for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.