ADFo 2 1 Practice
ADFo 2 1 Practice
Try It / Solve It
1. Use SQL Workshop to upload a script that creates the tables for the Demo Projects application. Perform the following steps:
a) Click SQL Workshop and select SQL Scripts.
b) Click Upload.
c) Click Choose File, navigate to the working directory where you extracted apex-course-labs.zip.
Locate the Project_Basic_Tables.sql file, and double-click the file or click the file and then click Open.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
2
d) Click Upload.
f) Click the Run icon to the right of the script you uploaded.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
3
g) Click the View Results icon for the script you just ran.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
4
2. Currently the tables you created do not have any data. A script has been provided that creates an Oracle database package which
can be run at any time to insert or reset the data in the tables. Use SQL Workshop to upload a script that you can use to populate
table data. Perform the following steps:
a) Click SQL Scripts. Click Upload.
b) Click Choose File, where you extracted apex-course-labs.zip.
c) Locate the Project_Data.sql file, and double-click the file or click the file and then click Open.
d) Click Upload.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
5
e) Click the Run icon to the right of the script you uploaded (top row).
f) Click the View Results icon for the script you just ran (top row).
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
6
3. In step 1, you uploaded a package called DEMO_PROJECTS_DATA_PKG. However, this package has not yet been run so the
tables you created still do not have any data. The SQL Commands facility, within SQL Workshop, allows a developer to run any
valid SQL commands. You will run a SQL command to execute the data package and populate the tables. Use SQL Commands to
execute n Oracle Database package. Perform the following steps:
begin demo_projects_data_pkg.load_sample_data;
end;
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
7
d) Click Run.
4. Use the Object Browser within SQL Workshop to review all of the database objects, such as the tables and packages you created,
available in the underlying Oracle database schema which is associated with the Application Express workspace you logged into.
Perform the following steps:
a) At the top of the page, select SQL Workshop and then select Object Browser.
b) In Object Browser, select the DEMO_PROJ_TEAM_MEMBERS table, and then click on the Data tab.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
8
Note: There are a number of other tables listed, outside of those you created using the script file above. The APEX$ tables are
created by Application Express to store internal data specific to your workspace. Tables such as DEMO_CUSTOMERS were
created when the Sample Database Application was installed. The Sample Database Application is installed by default when
an Application Express Workspace is created.
c) To review the package you created, select Packages and select DEMO_PROJECTS_DATA_PKG. Click Body to review the
primary PL/SQL rather than the specification.
Note: This package includes complex PL/SQL code to insert images and replicate users entering in records. It is not important
that you understand the PL/SQL code in this package, as you will not normally have to populate data in this matter. Generally,
you would create the tables with no data and then use the application you build to insert the records.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
9
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
10
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
11
4. Click Choose File, open the working directory where you extracted apex-course-labs.zip. Locate the hardware.csv file, and
double-click the file or click the file and then click Open.
Ensure that First row contains column names is selected, accept the remaining defaults, and click Next.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
12
5. Enter Hardware for Table Name, verify the table properties, and click Next.
6. Accept the defaults on the Load Data - Primary Key page, and click Load Data.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
13
7. The new table is now created and is populated with the data.
Click Object Browser.
9. You want to create a lookup table now. Perform the following steps:
a) Click Table. Click Create Lookup Table.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
14
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
15
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.