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

@Set multiple strings in a list as 1 variable #18684

Closed
aspano79 opened this issue Jan 6, 2023 · 2 comments
Closed

@Set multiple strings in a list as 1 variable #18684

aspano79 opened this issue Jan 6, 2023 · 2 comments

Comments

@aspano79
Copy link

aspano79 commented Jan 6, 2023

Description

I'm trying to set multiple strings in a variable that I can use in multiple case statements within my query.

@set olv_code = in ('857','858','859','865','866','867','868','869','870’,’871','813','814','815','816','820','821','822','823','824','825','826','819','298', '299', '300', '301', '302', '303', '304', '233', '234', '235', '259', '260', '261', '031', '032', '033')

SELECT
campaign,
CASE est_code = :olv_code then 1 else 0 end as test

Any guidance on creating a "list" that can be used in my case statements? I have 49 instances in a 900-line query, and codes need to be added continually so I would prefer to only add the codes once each time.

Thanks in advance!

DBeaver Version

Community 21.3.5

Operating System

Windows 10

Database and driver

Hive
Hadoop / Apache Hive

Steps to reproduce

No response

Additional context

No response

@ShadelessFox
Copy link
Member

Hello @aspano79,

The @set command is not supposed to evaluate to something. It's just replaced by the value assigned to it.

@ShadelessFox ShadelessFox closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2023
@E1izabeth
Copy link
Member

Duplicate of #10131

@E1izabeth E1izabeth marked this as a duplicate of #10131 Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants