Generate and Execute the Code for an Apply Activity Using SQL Developer
The Oracle Data Mining 10.2.0.3 Tutorial also contains examples of generating and executing code.
Note: Oracle Data Miner 10.2.0.4 and Oracle Data Miner 11.1 allow you to generated code using Oracle SQL Developer 1.0 or Oracle SQL Developer 1.2.
Follow these steps to generate and execute code for the apply activity DEMO_SVM_AA
:
- Start Oracle SQL Developer and connect to the data mining server.
- Generate code for the apply activity
DEMO_SVM_AA
.
- Execute the generated code.
Start SQL Developer and Connect
Start SQL Developer. 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 connection:
- Connect to the database: Expand Connections, 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
.
Execute the Generated Code
Follow these steps to execute the generated code:
- Expand Packages in the database connection where you created the activities.
- 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
.
- Select
DEMO_SVM_APPLY
(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'
. 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. In the procedure call, 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 code 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
.

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