Escaping user defined SQL Queries

Tagged:
  • mgerber
    Teilnehmer
      vor 5 Jahren, 4 Monaten #19838

      Is there a possibility to Escape “:” on user defined SQL queries?

      I have a Connector with the query as a varible. The query is built in a Business-Object and passed to the Connector.

      A query like this “UPDATE xyz SET a=’xy:1234′ WHERE xyz; UPDATE xyz SET b=’xy:123′ WHERE xyz;” will result in an error. Simplifier seems to read everything between “:” as a variable and throws an Error if no Value is provided.

      How can I Escape those “:”?

      mgerber
      Teilnehmer
        vor 5 Jahren, 4 Monaten #19843
        Up
        0
        Down
        ::

        The same problem is here: FORMAT([Timestamp_Create], ‘dd.MM.yyyy hh:mm:ss’) AS Timestamp_Create

        This results in: “message”: “The index 2 is out of range.”

        Armin Winkler
        Moderator
          Has successfully completed the online course Introduction
          Has successfully completed the online course Intermediate (200)
          Has successfully completed the online course Advanced (300)
          Has successfully completed the online course Basics (100)
        vor 5 Jahren #21772
        Up
        0
        Down
        ::

        Hello,

        have you tried using backward slashes as escape character to your SQL statements (see also: https://www.w3schools.com/js/js_strings.asp)?

         

        Regards,

        Armin

      Ansicht von 3 Beiträgen – 1 bis 3 (von insgesamt 3)

      You must be logged in to reply to this topic.