简体   繁体   中英

Redshift Query Syntax error (using SQL Workbench): Is there an easy way to go directly to the "position" mentioned in the error?

Is there an easy way to go directly to the position mentioned in an error message in SQL Workbench/Redshift (error provided below the code)? Thanks!

Here is the error:

An error occurred when executing the SQL command:

select application_id, case when stage_name in ( 'Application Review', 'New Lead', 'Recruiter Review', 'Reached Out', ...

Amazon Invalid operation: syntax error at or near ")" Position: 201 ; [SQL State=42601, DB Errorcode=500310] 1 statement failed.

Execution time: 0.16s

Here's the Query:

    select
    application_id,
    case when stage_name in (
      'Application Review',
      'New Lead',
      'Recruiter Review',
      'Reached Out',
      'Make Decision',
      'Resume Review',
    ) then 'Application Review' 
    when stage_name in ('Preliminary Phone Screen', 'Recruiter Screen','Handoff','Researcher Screen','Exploratory') then 'Recruiter Screen' 
    when stage_name in (
      'Phone Interview',
      'Phone Interview 2'
      'Phone Interview #1',
      'Phone Interview #2',
      'Phone/Initial Interview #1',
      'Phone/Initial Interview #2',
      'Hiring Manager Review',
      'Hiring Manager Screen',
      'Final Interview',
      'Take Home Test',
      'Initial Interview') 
      then 'Initial Interview' 
    when stage_name in 
    ( 'Onsite Interview #1',
      'Face to Face',
      'Face to Face 2',
      'Onsite Interview #2',
      'Onsite Interview') 
      then 'Onsite Interview' 
    when stage_name = 'Homework' then 'Homework' when stage_name in 
    ( 'Post Onsite',
      'Reference Check',
      'Hiring Review',
      'Hiring Review Debrief',
      'Hiring Review/Debrief',
      'Post Hiring Review / Debrief',
      'Post Hiring Review/Post Debrief',
      'Hiring Review / Debrief',
      'Post Hiring Review / Post Debrief',
      'Team Match') 
      then 'Post Onsite' 
    when stage_name = 'Byteboard Interview' then 'Byteboard Interview' 
    when stage_name IN ('Filtered','Filtered.ai Matching') then 'Filtered' 
    when stage_name = 'HackerRank Test' then 'HackerRank Test' 
    when stage_name = 'ClassMarker' then 'ClassMarker'
when stage_name = 'Offer' then 'Offer' 
else 'Other' end as app_Stage_Name_group,
    min(entered_on) as entered_on,
    max(exited_on) as exited_on
  from
    application_stages
  where
    entered_on is not null
  group by
    1,
    2

If you are using Build 125, you can configure this through workbench.settings by using the same settings that are used for Postgres to identify the error position.

Edit the file with a regular text editor and add these two lines:

workbench.db.redshift.errorinfo.regex.position=(?i)position:\\s+[0-9]+
workbench.db.redshift.errorinfo.leading.comment.included=true

Then the cursor should automatically jump to the position in the editor identified by the error message.

The settings file is located in the configuration directory . The exact location is shown in the about dialog and the options dialog.

Make sure you close SQL Workbench/J before editing the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM