Skip to content

SQL Execute returned an error: HY000: [SQLite]ESCAPE expression must be a single character (1) #9

@chainria

Description

@chainria

I am trying to get Asterisk 13.14 to work with sqliteodbc, but I am having troubles with it. I really don't know how to fix this error. Tried to replicate the problem using isql, Asterisk uses prepared statements but the outcome seems the same:

#1: The query as stated by Asterisk:
SQL> SELECT * FROM "ast_extensions_table" WHERE exten like "\_%" ESCAPE "\\" AND priority = 1 AND context = "incoming"
[ISQL]ERROR: Could not SQLExecute

#2: Simply trying to ashere to the error message:
SQL> SELECT * FROM "ast_extensions_table" WHERE exten like "\_%" ESCAPE "\" AND priority = 1 AND context = "incoming"
(data snipped)
SQLRowCount returns 0
1 rows fetched

How can I make the first query work? It is coming straight from asterisk, so I cannot change much there. If code in sqliteodbc itself needs to be changed just for this case / breaks other things am fine with that as well, since I can build a local package if needed. I just don't know whether it's a bug or just a very rare problem only I have.

(Edited to fix vanishing backslashes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions