{
  "synLogic": "$api($1, $2, $3);",
  "help": "The function ns_db_replay_query_end() is used to end a transaction with a given status and an optional message.",
  "notes": "Status 0 will be considered as success.\n Status 1 will be considered as internal failure: for exmaple max connection reached, query index greater then total query count.\n status > 1 will be considered as DB query failure.\nInternal error is mapped to TX error code 93 and db error is Mapped to Tx error 94.",
  "returns": "This api returns '0' on success.",
  "arguments": "\u003ctable class\u003d\"newGuiTable\" style\u003d\"width:100%\" \u003e	\u003ctr\u003e \u003cth\u003e Argument \u003c/th\u003e \u003cth\u003e Description \u003c/th\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e Query Id \u003c/td\u003e \u003ctd\u003e The transaction is identified by the idx parameter, which specifies the transaction index. \u003c/td\u003e  \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e Status \u003c/td\u003e \u003ctd\u003e The status parameter indicates the result of the transaction, with a value of 0 indicating success, 1 indicating an internal failure, and any other value indicating a database query failure. \u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e Message \u003c/td\u003e \u003ctd\u003e If an error message is provided, it will be stored in the msg parameter. \u003c/td\u003e \u003c/tr\u003e \u003c/table\u003e",
  "parameterization": "",
  "name": "ns_db_replay_query_end",
  "syntax": "int ns_db_replay_query_end(int idx, int status, char *msg)",
  "javaSyntax": "int ns_db_replay_query_end(int queryId, int status, String msg)",
  "jsSyntax": "int ns_db_replay_query_end(int queryId, int status, String msg)",
  "cEx": "flow()\n{\n  int idx = 123;\n  int status = 0;\n  char *msg = \"Transaction completed successfully.\";\n\n  int result = ns_db_replay_query_end(idx, status, msg);\n\n  if (result == 0) {\n    printf(\"Transaction ended successfully.\");\n  } else {\n    printf(\"Transaction ended with errors.\");\n  }\n}",
  "javaEx": "public class flow implements NsFlow\n{\n  public int execute(NSApi nsApi) throws Exception\n  {\n    int idx = 123;\n    int status = 0;\n    String msg = \"Transaction completed successfully.\";\n\n    int result = nsApi.ns_db_replay_query_end(idx, status, msg);\n\n    if (result == 0) {\n      System.out.println(\"Transaction ended successfully.\");\n    } else {\n      System.out.println(\"Transaction ended with errors.\");\n    }\n  }\n}",
  "jsEx": "  let idx = 123;\n  let status = 0;\n  let msg = \"Transaction completed successfully.\";\n\n  let result = nsApi.ns_db_replay_query_end(idx, status, msg);\n\n  if (result == 0) {\n    console.log(\"Transaction ended successfully.\");\n  } else {\n    console.log(\"Transaction ended with errors.\");",
  "insertStrC": "ns_db_replay_query_end(int idx, int status, char *msg);",
  "insertStrJava": "ns_db_replay_query_end(int queryId, int status, String msg);",
  "insertStrJs": "ns_db_replay_query_end(int queryId, int status, String msg);",
  "description": "",
  "component" : [
	  {
      "id": "$1",
      "type": "TextField",
      "label": "Query Id",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter queryId",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Number",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 2147483647,
        "method": ""
      }
    },
    {
      "id": "$2",
      "type": "TextField",
      "label": "Status",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter status",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Number",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 2147483647,
        "method": ""
      }
    },
    {
      "id": "$3",
      "type": "TextField",
      "label": "Message",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter message",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0
      }
    }
  ]
}
