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

Stored Procedure Bug #728

Closed
zacandcheese opened this issue Sep 27, 2023 · 0 comments · Fixed by #780
Closed

Stored Procedure Bug #728

zacandcheese opened this issue Sep 27, 2023 · 0 comments · Fixed by #780
Assignees
Labels
Bug Something isn't working. Jupyter Anything related to Jupyter: Magic Extensions (%sql, %chart...), display...

Comments

@zacandcheese
Copy link
Contributor

Intro

I would like to create a stored procedure similar to how I can in the VSQL terminal.

Reproducer

VSQL

verticadb21455=> CREATE PROCEDURE dl_runner() as $$ BEGIN EXECUTE 'EXECUTE DATA LOADER public.temp'; END; $$;
CREATE PROCEDURE

VerticaPy

%%sql
CREATE PROCEDURE dl_runner() as $$ BEGIN EXECUTE 'EXECUTE DATA LOADER public.temp'; END; $$;

---------------------------------------------------------------------------
QueryError                                Traceback (most recent call last)
Cell In[27], line 1
----> 1 get_ipython().run_cell_magic('sql', '', "CREATE PROCEDURE dl_runner() as $$ BEGIN EXECUTE 'EXECUTE DATA LOADER public.temp'; END; $$;\n")

File ~/.local/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2493, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
   2491 with self.builtin_trap:
   2492     args = (magic_arg_s, cell)
-> 2493     result = fn(*args, **kwargs)
   2495 # The code below prevents the output from being displayed
   2496 # when using magics with decorator @output_can_be_silenced
   2497 # when the last Python token in the expression is a ';'.
   2498 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/.local/lib/python3.10/site-packages/verticapy/sql.py:288, in sql(line, cell, local_ns)
    285     print(query_type)
    287 elif error:
--> 288     raise QueryError(error)
    290 elif verticapy.options["print_info"]:
    291     print(query_type)

QueryError: Severity: ERROR, Message: Unterminated dollar-quoted string at or near "$$ BEGIN EXECUTE 'EXECUTE DATA LOADER public.temp'; END", Sqlstate: 42601, Position: 33, Routine: base_yylex, File: /scratch_b/znowak/repos/server/vertica/Parser/scan.l, Line: 694, Error Code: 5307, SQL: "CREATE PROCEDURE dl_runner() as $$ BEGIN EXECUTE 'EXECUTE DATA LOADER public.temp'; END"
@oualib oualib added the Jupyter Anything related to Jupyter: Magic Extensions (%sql, %chart...), display... label Sep 27, 2023
@oualib oualib self-assigned this Sep 27, 2023
@oualib oualib added the Bug Something isn't working. label Sep 27, 2023
@oualib oualib linked a pull request Oct 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working. Jupyter Anything related to Jupyter: Magic Extensions (%sql, %chart...), display...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants