Generate and Execute the Code for an Apply Activity Using JDeveloper
The Oracle Data Mining 10.2.0.3 Tutorial also contains examples of generating and executing code.
This example generates and executes a PL/SQL package. These packages are callable from Java programs.
Follow these steps to generate and execute code for the apply activity DEMO_SVM_AA
:
- Start Oracle JDeveloper and connect to the data mining server.
- Generate code for the apply activity
DEMO_SVM_AA
.
- Execute the generated code.
Start JDeveloper and Connect
Start JDeveloper. Connect to the data mining server as follows:
- Click the Connections tab.
- If necessary, define a connection to the database and account where you created the apply activity. To create a database connection:
- Right-click Connections
- Select New Database Connection
- When you create a connection, click Deploy Password to avoid having to type the password for the database connection.
- Connect to the database: Expand Connections, expand Database, select the connection, right-click, and select Connect.
Generate Code
Follow these steps to generate code:
- Select File | New.
- In the New Gallery, expand Database Tier and select Database Objects. If you do not see Database Objects, set Filter By to All Items.
- Select Data Mining PL/SQL Package and click OK.

- Use the wizard to generate the code. Select the activity
DEMO_SVM_AA
. Name the package DEMO_SVM_APPLY_JDEV
.
Execute the Generated Code
Follow these steps to execute the generated code:
- In the database connection, expand the user schema where you generated the activities.
- Expand Packages.
- Before you execute the code, you must select an apply procedure and specify parameters for it. Select the apply procedure as follows:
- Expand
DEMO_SVM_APPLY_JDEV
.
- Select
DEMO_SVM_APPLY_JDEV
(the header), right-click, and select Run. If the code has not already compiled, it compiles.
- In the Target list, select the apply procedure that has tables or views for input and tables or views for output. This is the procedure with the
_TT
suffix.
- Set parameters by editing the
BEGIN
block in the PL/SQL Block pane as follows:
- Set
APPLY_RESULT_NAME
to 'DEMO_OUTPUT_J'
. If you do not change the name of the apply output, executing the procedure will invalidate the state of the apply activity.
- Set
TABLE_OUTPUT
to TRUE
.
- Make the procedure re-executable by setting
DROP_OUTPUT
to TRUE
.
- For this example, use the same case table that the activity uses. To do this, comment out the assignment
CASE_TABLE => CASE_TABLE
. Use --
to comment the line out.
- To use the model that the activity uses, comment out
MODEL_NAME => MODEL_NAME
.
- There are no additional tables, so comment out
ADDITIONAL_TABLE_1 => ADDITIONAL_TABLE_1
.

- Click OK to execute the selected procedure with these parameters.
- The procedure executes. If there are any problems, messages describing the problems appear in the Running - Log tab. If there are no problems, the process exits and disconnects from the database connection.
- After execution completes, view the output table. Expand Tables and double-click
DEMO_OUTPUT_J
. The structure of the table is displayed.

To see the data, click the Data tab.
Copyright © 2006, 2008, Oracle. All rights reserved.