Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go statement for Oracle #239

Closed
paulkatich opened this issue May 28, 2019 · 5 comments
Closed

Go statement for Oracle #239

paulkatich opened this issue May 28, 2019 · 5 comments

Comments

@paulkatich
Copy link

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.

@shantstepanian
Copy link
Contributor

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

@shantstepanian
Copy link
Contributor

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

@paulkatich
Copy link
Author

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

@shantstepanian
Copy link
Contributor

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

@shantstepanian
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants