Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CI/CD Shell script with SQLcl

I have worked all day to be able to use SQLcl in shell scripts intended for CI/CD tools. My goal is to import/export Apex applications.

Right now these examples seems to fit my need :

  • Project directories
project/
	build-tools/
		sqlcl/
			bin/
			lib/
			...
		sqlclscripts/
			run.sh
			test.sqlcl
			apexexport.sqlcl
			apeximport.sqlcl
			...
	src/
		apex/
			app.sql
	dev.env
  • run.sh : Script that receive another script as an argument
#!/bin/bash 
RUNSCRIPT=$1
../sqlcl/bin/sql -s -L USER/PWD@server:9999/DBNAME <<EOF
$(cat $RUNSCRIPT.sqlcl) 
EOF
  • To run the a script :
./run.sh apexexport

With this I can create almost anything using Javascript to run from my CI/CD runner.

Anyone have better ideas doing this? If not, I hope it can help someone!

This post has been answered by Alexandre Courchesne on Feb 20 2025
Jump to Answer
Comments
Post Details
Added on Feb 12 2025
8 comments
988 views