APEX 5.1.4页面流程调用数据库包PSPRT_AUTH_PKG的脚本咨询
Hey there! Let me walk you through exactly how to set up that page process to call your PSPRT_AUTH_PKG.CREATE_ACCOUNT procedure in APEX 5.1.4, passing in your page items as parameters.
Here's a step-by-step breakdown with the exact code you need:
1. Create a New PL/SQL Page Process
First, navigate to the page where you want this process to run (it can be page 3 itself, or any page that has access to the session state of :P3_USER_ID and :P3_PASSWORD):
- Under Page Processing, right-click Processes → select Create
- Pick PL/SQL as the process type, then click Next
2. Configure the Process & Add the PL/SQL Code
- Give your process a clear name, like "Execute Create Account Procedure"
- Paste this code into the PL/SQL Code field:
BEGIN PSPRT_AUTH_PKG.CREATE_ACCOUNT( p_user_id => :P3_USER_ID, -- Maps to your page 3 user email item p_password => :P3_PASSWORD -- Maps to your page 3 password item ); END;
Important: Double-check that the parameter names (
p_user_id,p_password) match exactly what's defined in yourPSPRT_AUTH_PKGpackage. Adjust them if your procedure uses different parameter labels!
3. Set Execution & Error Handling
- Under Execution Options, choose the right Point for when the process runs (e.g., "On Submit - After Computations and Validations" if it's triggered by a button click)
- Add a condition if needed (like checking that
:P3_USER_IDand:P3_PASSWORDaren't null before executing) - Set a user-friendly Error Message (e.g., "Failed to create your account. Please verify your details and try again.") to handle any exceptions thrown by the package procedure.
Quick Prerequisite Check
Make sure the APEX application's schema has EXECUTE privileges on your package. If not, run this SQL in your database:
GRANT EXECUTE ON PSPRT_AUTH_PKG TO your_apex_schema_name;
内容的提问来源于stack exchange,提问作者Rebecca

