Navigation Menu

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

Error while calling oracle package as part of creation statement #46

Closed
yogeshnv opened this issue Nov 25, 2020 · 1 comment
Closed

Comments

@yogeshnv
Copy link

Hello, I have created and configured the oracle db endpoint. DBA's have provided me a package to use as part of creation statement for creating new user. The package accepts old user, new user and password as arguments to the function.

Below is the vault command and the creation statement.

./vault write database/roles/my-role db_name=mydb creation_statements="EXECUTE PKG_USER.create_user('olduser','{{name}}','{{password}}');" default_ttl="10m" max_ttl="10m"

When I execute the vault command for creating credential, I am getting invalid sql statement error. I tried different combinations by removing quotes using BEGIN END instead of EXECUTE but it didn't help. Appreciate your insight into this.


vault read database/creds/my-role

Error reading database/creds/my-role: Error making API request.

URL: GET https://127.0.0.1:8200/v1/database/creds/my-role
Code: 500. Errors:

  • 1 error occurred:
    * rpc error: code = Unknown desc = ORA-00900: invalid SQL statement
@yogeshnv yogeshnv closed this as completed Dec 8, 2020
@yogeshnv
Copy link
Author

yogeshnv commented Dec 8, 2020

I was able to successfully call the procedure by using BEGIN, END and providing public synonym (synonym.pkg_user.create_user()). Also ended up base64 encoding the string as part of creation statement.

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

1 participant