Skip to Main Content

APEX

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!

Looking for an integrated SQL checker in APEX

oraLaroNov 27 2024

Am DBA, We have a 150-200 sql/plsql developers onsite.

The code is written in many formats with many tools so The quality of SQL that comes into us varies vastly.

We have many standards. They are broken regularly so we send SQL back with a copy of our standards.

Take this for example

Create table my_table  tab_forstuff 

(col1 number, col2 varchar)

this is an actual example.

Table should have schema defined.

Should be named meaningful (we can enforce with 3 letters at start of it)

Should be no space after create table

Columns should be named

PK defined.

Grants and Synonyms missing

And maybe a few others we could give suggestions on like constraints and indexes but this is a simple enough example to work with.

So how do we enforce standards BEFORE the code gets to us and we end up chewing time back and forth. There are a number of online code checkers and prettifiers but we are unable to use them, it must be on premises.

There is a code linter called sqlfluff we could integrate with VScode and sql developer plugin. We have piloted this on a client and it works well as a concept on a client. However this would require an install on every client and some maintenance of the sqlfluff plugin every time we alter the config for standards.

So wouldnt it be great if we had a single Apex page that would take a free hand SQL or a .sql file upoload and do this for us to a standard that we define?

Yes, I hear you cry, it would.

Any ideas on how to do it?

Comments
Post Details
Added on Nov 27 2024
4 comments
288 views