Skip to content

Validation with SQL with Brackets #1294

Answered by manticore-projects
rider87 asked this question in Q&A
Discussion options

You must be logged in to vote

This works:

  @Test
  public void test() throws JSQLParserException {
    String sqlStr = "Select year([x].[test]) FROM x";

    FeatureConfiguration features = new FeatureConfiguration();
    features.setValue(Feature.allowSquareBracketQuotation, true);
    
    Validation validation =
        new Validation(features, Arrays.asList(DatabaseType.SQLSERVER), sqlStr);
    
    List<ValidationError> errors = validation.validate();
    assertEquals(0, errors.size());
  }

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wumpz
Comment options

Answer selected by wumpz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants