Access an Oracle Database Using SQLcl
Using SQLcl, you can run SQL statements from a build to connect and access an Oracle Database. You can use SQLcl to access any publicly available Oracle Database that you can connect to using a JDBC connect string. You can run DML, DDL, and SQL Plus statements. You can also use SQLcl in a test scenario and run SQL scripts to initialize seed data or validate database changes.
To learn more about SQLcl, see
http://www.oracle.com/technetwork/developer-tools/sqlcl/overview/index.html
.
Also see Using the help command in SQLcl in
Using Oracle Database Exadata Express Cloud
Service and the SQL Developer Command-Line Quick
Reference documentation to know more about using
SQLcl supported commands.
To connect to Oracle Database Exadata Express Cloud Service, download the ZIP file that contains its credentials and upload it to the job’s Git repository. You can download the ZIP file from the Oracle Database Cloud Service service console. See Downloading Client Credentials in Using Oracle Database Exadata Express Cloud Service.
Set Up a VM Build Executor and a Build Executor Template with SQLcl
Note:
To find your organization administrator, click Contacts under your user profile. Your administrator, or a list of administrators, will display.See Create and Manage Build Executor Templates in Administering Visual Builder Studio.
After the organization administrator adds a VM build executor to the build executor template, you can create and configure a job to use that build executor template and add SQLcl commands.
Configure a Job to Run SQLcl Commands
- VB Studio doesn’t support SQL commands to edit buffer (such as
set sqlformat csv
) or edit console. - VB Studio doesn’t support build parameters in the SQL file.
- If you are using Oracle REST Data Services (ORDS),
some SQLcl commands, such as the BRIDGE command, requires a
JDBC URL:
BRIDGE table1 as "jdbc:oracle:thin:DEMO/demo@http://examplehost.com/ords/demo"(select * from DUAL);
- To mark a build as failed if the SQL commands fail,
add the
WHENEVER SQLERROR EXIT 1
line to your script.
Here's how you create and configure a job that runs SQLcl commands: