Tomasz
Tomasz

Reputation: 160

APEX ORACLE How to run a SQL procedure from the link

I would like to run the SQL procedure from a crafted link on the page. I'd like to use apex "processes" for this.

My SQL procedure:

CREATE OR REPLACE PROCEDURE TEST_X
(
  P_ID in integer
)
AS 
BEGIN
  insert into ...
END TEST_X;

Example link:

<a href="">Click here</a>

I would like the link to perform the procedure TEST_X(10)

Upvotes: 0

Views: 1631

Answers (2)

Koen Lostrie
Koen Lostrie

Reputation: 18650

While the above answer is absolutely correct, you could also do this with a dynamic action, that is a bit more "modern" in apex. Example: create static region with text

<div id="mylink"><a href=#>click here</a></div>

Then create a dynamic action that references the jquery selector "mylink" enter image description here

Add a true action to the dynamic action of type "Execute pl/sql code" and you're done.

Upvotes: 2

mohamad subhi bouchi
mohamad subhi bouchi

Reputation: 190

create an ajax process and write your procedure body. then you can make ajax request from javascript when user click on that link

Upvotes: 1

Related Questions