goldmansachs/obevo

Go statement for Oracle

paulkatich opened this issue · 5 comments

The reverse engineering tool terminates blocks of sql changes using GO statements. Is this by design ? Oracle doesn't has a GO statement. Oracle uses '/' as a statement terminator.

Yes, it is by design, as Obevo's internal parser will split on GO, and it works across languages, thus giving a consistent experience. It also makes the translation to in memory databases easier, albeit we haven't built that for Oracle yet

That said, Obevo can work with the / separator (it just passes the sql through to the db), and the reverse engineering can be modified to make the terminator statement configurable

fyi - the change would be relatively small for me to do. But since you asked about submitting a pull request in the other ticket, I'd mention that you are free to submit pull changes for any ticket if you'd like. If you do have an interest in contributing on any of these issue, you can indicate so on the relevant issue

We are occupied with other tasks. We dont have much bandwidth for this change. Can you please do this change ?

Sure, I'll look to get to it by end of next week

After some testing and research, we won't be implementing this change. The existing setup with GO should work for you within Obevo

The reason that we can't implement this is that the JDBC APIs are typically only allowed to execute a single SQL command within a JDBC statement (see
link for reference. Though other DBMS
platforms and drivers could be more lenient for this, Oracle is not. Hence, if we were to try to pass in scripts delimited strictly by semicolon or slash, the JDBC calls would error out.

Hence, we will stick with the default GO splitter to split multiple statements in the reverse engineering.

Note that you can still use a single semicolon or slash to end a statement, even if followed by a GO. (Most notably,
to end a PL/SQL begin/end block with a slash, since the block may contain multiple semicolons). I've tested this and it is fine, so you should be safe to end your statements with slashes.

If you do ever want to execute these scripts via SQLPlus itself, then you can do a search-and-replace for GO, but note that you'd have to treat regular statements (ending with ;) and PL SQL blocks (ending with /) directly, so that is not trivial either.

It could theoretically be possible to support this if we supported executing deployments via SQL*Plus instead of JDBC, but that won't be in our dev plans for some time

I'll leave this ticket open for a few days in case you have additional questions or want to elaborate on your use case, but otherwise, I will eventually close it