Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2320

Not able to run upsert query over phoenix query server.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    Description

      Not able to run upsert query over phoenix query server. Select query works but for upsert query records are not inserted into phoenix.

      This is CODE

      <?php
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL,"http://localhost:8765/");
      curl_setopt($ch, CURLOPT_POST, true);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      $headers = array();
      // For Select.
      //$headers[] = 'request:

      {"request":"prepareAndExecute","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","sql":"select * from BLOG.POST"}

      ';

      // For Upsert.
      $headers[] = 'request:

      {"request":"prepareAndExecute","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","sql":"UPSERT INTO BLOG.POST (POST_ID,TITLE,CONTENT) values (\'aa11111\',\'Test Title\',\'this is test post content\')"}

      ';
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      $server_output = curl_exec ($ch);
      curl_close ($ch);

      OUTPUT
      {"response":"Service$ExecuteResponse","results":[

      {"response":"resultSet","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","statementId":1164383384,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}

      ]}

      But record is not inserted ...

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            elserj Josh Elser
            Appa Appasaheb Sawant
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment