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

Update Oracle database DBI parameter generation #25

Merged
merged 1 commit into from
Apr 5, 2024
Merged

Conversation

theory
Copy link
Collaborator

@theory theory commented Mar 31, 2024

Again. It now works as follows:

  • If there is not a hostname or port, just use the raw SID or service
    name as the database name: dbi:Oracle:$name. This is way 1 in the
    DBD::Oracle documentation
  • If there is a hostname or port, use the EZCONNECT syntax. This is
    way 3 in the DBD::Oracle documentation.

Use of a port without a host name may not be valid, but it seems most prudent to build an EZCONNECT that includes the port in this context and to let Oracle or DBD::Oracle reject it if appropriate. Thanks again to @vectro for the and diligence, testing, and patience with this issue (resolves #22).

while (@p) {
push @kvpairs => join '=', shift @p, shift @p;
}
$dsn .= '?' . join ';' => @kvpairs;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the EZCONNECT syntax, it looks like parameters should be separated by &. Don't ask me what to do if a parameter or value contains &.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bfbd9f8, thanks.

@vectro
Copy link

vectro commented Apr 2, 2024

Other than the & thing, this LGTM.

Again. It now works as follows:

-   If there is not a hostname or port, just use the raw SID or service
    name as the database name: `dbi:Oracle:$name`. This is way 1 in the
    DBD::Oracle documentation
-   If there is a hostname or port, use the EZCONNECT syntax. This is
    way 3 in the DBD::Oracle documentation.
-   If there are query parameters, delimit them by `&` and not `;`.

Use of a port without a host name may not be valid, but it seems most
prudent to build an EZCONNECT that includes the port in this context and
to let Oracle or DBD::Oracle reject it if appropriate. Thanks again to
@vectro for the and diligence, testing, and patience with this issue
(#22).
@theory theory merged commit bfbd9f8 into master Apr 5, 2024
90 checks passed
@theory theory deleted the issue-22 branch April 5, 2024 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oracle uri format does not allow connecting by service name
3 participants