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

Panic when calling procedure #20

Closed
arthrarnld opened this issue Mar 14, 2018 · 4 comments
Closed

Panic when calling procedure #20

arthrarnld opened this issue Mar 14, 2018 · 4 comments
Labels

Comments

@arthrarnld
Copy link

When trying to execute

CALL proc.myProc(?);

we get an invalid memory address or nil pointer dereference error.

This seems to be related to the use of the question mark, so maybe the driver is interpreting it as a placeholder in a prepared statement? If so, is it possible to escape it?

@stfnmllr
Copy link
Contributor

stfnmllr commented Mar 15, 2018

Yes, the ? is interpreted as place-holder for an in, in-out or out variable of the stored procedure. For what does the ? stand in your example? Can you please share the definition of the stored procedure and the go code calling it?

@arthrarnld
Copy link
Author

@d024441, according to the HANA Help Page:

The actual value passed for tabular OUT parameters must be?.

and

When you pass '?' to the output parameters, temporary tables holding the result sets will be generated. These tables will be dropped automatically once the database session is closed.

Without the question mark, how else could I invoke a procedure to simply get its result (as opposed to calling from within another procedure where the result could be stored in a local variable)?

Thanks!

@stfnmllr
Copy link
Contributor

stfnmllr commented Mar 15, 2018

Hi @arthurpaimarnold,

Without the question mark, how else could I invoke a procedure to simply get its result (as opposed to calling from within another procedure where the result could be stored in a local variable)?

Yes, sure. Please check the example code - maybe this will help:
call stored procedure with out parameter
call stored procedure with table result

If not - to reproduce the issue, we need

  • the definition (header) of the stored procedure and
  • the go code 'calling' the stored procedure

@arthrarnld
Copy link
Author

@d024441 the examples you provided solved the issue. Thank you very much!

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

No branches or pull requests

2 participants