Menu

Cannot declare variables: Invalid JDBC escape syntax at line position 20: '=' character expected

Help
Mike
2014-02-12
2016-12-23
  • Mike

    Mike - 2014-02-12

    Hi

    I'm having great difficulty in Oracle SQL Developer 4.0.0 trying to work with our MS SQL Server.

    The connection is fine, and I have tested SELECT with no problems, however when I try to declare a variable I get the error in the header.

    The syntax I have tried using is:

    DECLARE @test as date = '2013-01-01'

    It is always Charater 20 where the '=' sign is expected, unless the variable name is particularly long, in which case the expected character gets pushed along, for example:

    DECLARE @testanothervariable as date = '2013-01-01'

    ... will return the error "Invalid JDBC escape syntax at line position 35: '=' character expected".

    I have tried version 1.2 and 1.3.1 of JTDS, removing spaces, using {d '2013-01-01'} syntax, neither of which work. Please help!!!

     
  • Jitender

    Jitender - 2016-12-23

    I am getting the same error "Invalid JDBC escape syntax at line position 64 '=' character expected."
    At position 64 i have @lvl int=0 declared. Same code is parsed all right with jdbc but with JTDS it's throwing above exception. I have latest JTDS drivers (1.3.1) in my project.
    Any help would be appreciated.
    Thanks,
    Jitender

     

Log in to post a comment.