Conceptual Diagram of the Jobs Feature
The following diagram displays the conceptual workflow diagram of the Jobs feature:
Prerequisites
Before using the Jobs feature, you must decide the tasks you want the Jobs feature to automate. For each kind of job step that you want you must:
- Create a Data Load Job
- Create a Table AI Assist Recipe
- Create a PL/SQL Procedure
Note:
You can choose any of these prerequisites based on the task you want to perform. You can either create a Data Load Job, a Table AI Assist recipe or create a PL/SQL procedure.
Create a Data Load Job
- On the Data Load menu of Data Studio navigation, select Load Data.
- Click Cloud Store and select the Cloud Store Location from the drop-down.
- Select the format of the file you want to load from the drop-down. For example, to load a
csv
file, select *.csv from the drop-down. Drag and drop the folder with CSV files to the cart area. - Click Load Name to tag your load to assist in identifying your job during monitoring or Data Transforms. Enter the name of the load on the Name field. In this example, you specify DATA_LOAD. Click OK.
- Select Start in the data load cart menu bar to create a table you define and load it with data from the
csv
file. A Start Load from Cloud Store message is displayed. Click Run. The target table is created. - You can view the status of the newly loaded table on the Data Load Dashboard.
For more information on Loading Data from a Cloud Store, see Loading Data from Cloud Storage.
Create a Table AI Assist Recipe
- In the Navigation menu on the left, click Table AI Assist.
- On the Table AI Assist Recipes page, select + New Recipe besides the table you have created on the previous step.
The Edit Recipe page is displayed.
- Click Add Step. The Add Step panel is displayed.
- In the Enter a prompt in natural language or specify SQL for column text field, provide some natural language prompt of what you want to do such as
Next, click Ask AI.Extract Month from UPDATED_TIMESTAMP
-
A new generated
MONTH
column is displayed in the Data Preview section. The new column shows the month extracted from theUPDATED_TIMESTAMP
column. Note the generated SQL that performs this operation which you can also edit and run if you are familiar with SQL.Click Save to add the step.
- The Edit Recipe page is re-displayed. Scroll to the right of the table to display the newly added month column.
- Let us save the modified customer table as a new table named LIVE_FEED.
- Click the Target Type drop-down list and select Create Table. Change the table name in the Target Name field to LIVE_FEED and then click Create Table.
A Create Table dialog box is displayed. Click Yes.
A Confirmation message box is displayed. The table is created.
For more information, see The Table AI Assist Tool
Create a PL/SQL Procedure
You can create a PL/SQL Procedure with SQL worksheet editor.
- Click the Selector
icon to display the navigation menu. Under Development, select SQL.
You can use SQL and PL/SQL statements in the worksheet to create a procedure.
- Copy and paste the following code snippet on the editor area to print few lines of text:
create or replace procedure print_it(j_name in varchar2, sch_n in varchar2, step_num in number, num_steps in number) authid current_user is begin dbms_output.put_line('Job finished! ' || ' - in service of ' || j_name || '(' || step_num || '/' || num_steps || ')'); end;
Note:
This is just a sample code. You can useDBMS_CLOUD
procedures to load data into existing Autonomous Database table and perform other operations. Most of the operations you perform in Data Studio have a Show code. You can copy and run this PL/SQL code in the worksheet to perform the same action. - Run this code in the worksheet using the Run icon.
The Query Result tab displays the statements that you print in the output.
You have successfully created the procedure.