question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Snowflake procedure creation fails in DBeaver, not in Snowflake

See original GitHub issue

Description

I cannot create a snowflake procedure that has a CASE statement in one of it’s statements.

DBeaver Version

22.1.4.202208051447 22.2.0.202209051344

Operating System

Win 11

Database and driver

net.snowflake:snowflake-jdbc:RELEASE [3.13.6]

Steps to reproduce

Running this script:

CREATE OR REPLACE PROCEDURE does_not_work_from_dbeaver()
RETURNS NUMBER(1,0)
LANGUAGE SQL
EXECUTE AS CALLER
AS $$
	BEGIN
		
		SELECT  1
			,CASE 
				WHEN TRUE THEN '1' 
				ELSE '2' 
			END AS col1
		;
		
	END;	
$$;

in DBeaver gives this error:

Error occurred during SQL query execution

Reason:
SQL Error [1003] [42000]: SQL compilation error:
parse error line 15 at position 4 near '<EOF>'.
syntax error line 5 at position 4 unexpected '$'.

After much effort I found that the END of the CASE statement is giving DBeaver troubles. When I remove the case statement from the query, the code is accepted.

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HansKappertEnecocommented, Sep 17, 2022

Thank you. Now that my problem is solved, we can close this ticket. Kind regards, Hans Kappert

0reactions
LonwoLonwocommented, Sep 16, 2022

You can check this instrument: https://github.com/dbeaver/dbeaver/wiki/Query-Manager

You can see there - what statements do you execute.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to fix this snowflake SQL compilation error - Stack Overflow
Hi, I am getting this above error while trying to view, store procedure data in snow flake. Can somebody help me on this...
Read more >
Not able to connect to Snowflake trial instance. My guess is ...
I've tried using dbeaver, ETLwork and SnowSQL, but no luck? Error Message: Certificate for < <ACCOUNT NAME>.
Read more >
How to set up the DBeaver Snowflake Connection? 3 Easy ...
Click on the “Ok” button in the Connection Test dialog box. Step 8: Then, click on the “Finish” button in the Snowflake Connection...
Read more >
[Snowflake Quick Tips] How to start data modeling with DBeaver
This is a 5 minutes tutorial to quickly get you started on Snowflake data modeling. Copy and paste this SQL database creation script...
Read more >
No Source Code for Views and Stored Procedures
Try again using Heidi, if it works then it's a bug in DBeaver, if not, maybe its a user permissions error? Either way,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found