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

Add callproc to call stored procedures #320

Open
1 task done
mdesmet opened this issue Jan 11, 2023 · 3 comments
Open
1 task done

Add callproc to call stored procedures #320

mdesmet opened this issue Jan 11, 2023 · 3 comments

Comments

@mdesmet
Copy link
Contributor

mdesmet commented Jan 11, 2023

Describe the feature

DBAPI provides following method to call stored procedures.

.callproc( procname [, parameters ] )
(This method is optional since not all databases provide stored procedures. [3])
Call a stored database procedure with the given name. The sequence of parameters must contain one entry for each argument that the procedure expects. The result of the call is returned as modified copy of the input sequence. Input parameters are left untouched, output and input/output parameters replaced with possibly new values.

The procedure may also provide a result set as output. This must then be made available through the standard .fetch*() methods.

Describe alternatives you've considered

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@hashhar
Copy link
Member

hashhar commented Jan 11, 2023

There are no stored procedures yet on the server side. Can you share more detail about how it might be used?

@mdesmet
Copy link
Contributor Author

mdesmet commented Jan 11, 2023

See https://trino.io/docs/current/sql/call.html

For example there exists a stored procedure to register a table on Iceberg.

@hashhar
Copy link
Member

hashhar commented Jan 11, 2023

I don't think those are "stored procedures" regardless of what the docs say.

@martint / @dain Once/when SQL defined functions land do we expect to reuse the CALL statement to execute those?
I'd like to avoid a situation where we need to change what callproc does once SQL defined functions/SPs are available since it'd break user code.

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

No branches or pull requests

2 participants