Skip to Main Content

SQL & PL/SQL

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!

Call stored procedure through HTML

AB115May 10 2018 — edited May 10 2018

Hi All,

We have a requirement to call stored procedure from HTML button. the scenario is as below,

There is a notification created in HTML and we've added button in it. as soon as the user select any name from drop down used in HTML, by pressing add button, stored procedure will call and insert those entries into the table. For that, we have written below code but somehow it's not inserting the details into the table,

HTML Code in PL/SQL Package:

l_document :=

l_document

|| '<TABLE class="OraTableContent" CELLPADDING="1" CELLSPACING="0" BORDER="1">'

|| '<TR><TD class="OraTableColumnHeader" SCOPE="COL"  ALIGN="LEFT" VALIGN="TOP"><SPAN CLASS="OraTableHeaderLink">Adhoc Approver</SPAN></TD>'

|| '<TD ALIGN="LEFT" VALIGN="TOP" CLASS="dropdown"><SELECT id="select1">';

      FOR c_get_appr IN cur_get_adhoc_appr

      LOOP

l_document :=

l_document

|| '<option value="'

|| c_get_appr.user_name

|| '">'

|| c_get_appr.user_name

|| '</option>';

      END LOOP;

      l_document :=

l_document

|| '</select></TD><TD><button onclick="insertapprover(GetSelectedItem(select1));">Add</button></TD></TR>'

|| '<TR><TD class="OraTableColumnHeader" SCOPE="COL" ALIGN="LEFT" VALIGN="TOP"><SPAN CLASS="OraTableHeaderLink">Adhoc Watcher</SPAN></TD>'

|| '<TD ALIGN="LEFT" VALIGN="TOP" CLASS="dropdown"></TD></TR>'

|| '</TABLE>';

Stored Procedure:

PROCEDURE insertapprover (appr_name IN VARCHAR2)

   IS

l_char_adhoc   VARCHAR2 (100);

   BEGIN

      l_char_adhoc := appr_name;

      INSERT INTO xxc8785_adhoc_table

VALUES (l_char_adhoc);

      COMMIT;

END insertapprover;

Please suggest.

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2018
Added on May 10 2018
3 comments
134 views